Learn R Programming

wmwpow (version 0.1.3)

wmwpowd: Precise and Accurate Monte Carlo Power Calculation by Inputting Distributions F and G (wmwpowd)

Description

wmwpowd has two purposes:

1. Calculate the power for a one-sided or two-sided Wilcoxon-Mann-Whitney test with an empirical p-value given two user specified distributions.

2. Calculate p, the P(X<Y), where X represents random draws from one continuous probability distribution and Y represents random draws from another distribution; p is useful for quantifying the effect size that the Wilcoxon-Mann-Whitney test is assessing.

Both 1. and 2. are calculated empirically using simulated data and output automatically.

Usage

wmwpowd(n, m, distn, distm, sides, alpha = 0.05, nsims = 10000)

Arguments

n

Sample size for the first distribution (numeric)

m

Sample size for the second distribution (numeric)

alpha

Type I error rate or significance level (numeric)

distn

Base R<U+2019>s name for the first distribution and any required parameters ("norm", "beta", "cauchy", "f", "gamma", "lnorm", "unif", "weibull","exp", "chisq", "t", "doublex")

distm

Base R<U+2019>s name for the second distribution and any required parameters ("norm", "beta", "cauchy", "f", "gamma", "lnorm", "unif", "weibull","exp", "chisq", "t", "doublex")

sides

Options are <U+201C>two.sided<U+201D>, <U+201C>less<U+201D>, or <U+201C>greater<U+201D>. <U+201C>less<U+201D> means the alternative hypothesis is that distn is less than distm (string)

nsims

Number of simulated datasets for calculating power; 10,000 is the default. For exact power to the hundredths place (e.g., 0.90 or 90%) around 100,000 simulated datasets is recommended (numeric)

References

Mollan K.R., Trumble I.M., Reifeis S.A., Ferrer O., Bay C.P., Baldoni P.L., Hudgens M.G. Exact Power of the Rank-Sum Test for a Continuous Variable, arXiv:1901.04597 [stat.ME], Jan. 2019.