Wilcoxon-Mann-Whitney Sample Size Planning

Calculates the minimal sample size for the Wilcoxon-Mann-Whitney test that is needed for a given power and two sided type I error rate. The method works for metric data with and without ties, count data, ordered categorical data, and even dichotomous data. But data is needed for the reference group to generate synthetic data for the treatment group based on a relevant effect. For details, see Brunner, E., Bathke A. C. and Konietschke, F: Rank- and Pseudo-Rank Procedures in Factorial Designs - Using R and SAS, Springer Verlag, to appear.


CRANstatus Travis-CI Build Status codecov

Calculates the minimal sample size for the Wilcoxon-Mann-Whitney test that is needed for a given power and two sided type I error rate. The method works for metric data with and without ties, count data, ordered categorical data, and even dichotomous data. But data is needed for the reference group to generate synthetic data for the treatment group based on a relevant effect. For details, see

Brunner, E., Bathke A. C. and Konietschke, F: Rank- and Pseudo-Rank Procedures in Factorial Designs - Using R and SAS, Springer Verlag, to appear,

Happ, M., Bathke, A. C., & Brunner, E. (2018). Optimal Sample Size Planning for the Wilcoxon-Mann-Whitney-Test. arXiv preprint arXiv:1805.12249.

To install the current development version:

## install devtools package if it's not already
if (!requireNamespace("devtools", quietly = TRUE)) {
  install.packages("devtools")
}
# install package
devtools::install_github("happma/WMWssp")
library(WMWssp)

To calculate the sample size we need prior information from one group. Let us call this group reference group. Based on this reference group, we can create artifical data according to an interpretable effect. Note that we have to specify, how many subjects should be assigned to the first and how many to the second group.

# Prior information for the reference group
x <- c(315,375,356,374,412,418,445,403,431,410,391,475,379)
# generate data for treatment group based on a shift effect
y <- x - 20
 
# calculate sample size
ssp <- WMWssp(x, y, alpha = 0.05, power = 0.8, t = 1/2)
summary(ssp)

It is also possible to vary the allocation rate to even further reduce the sample size.

# calculate optimal allocation rate t
ssp <- WMWssp_minimize(x, y, alpha = 0.05, power = 0.8)
summary(ssp)

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("WMWssp")

0.3.4 by Martin Happ, 7 months ago


http://github.com/happma/WMWssp


Report a bug at http://github.com/happma/WMWssp/issues


Browse source code at https://github.com/cran/WMWssp


Authors: Arne C. Bathke [aut] , Edgar Brunner [aut] , Martin Happ [aut, cre] , Frank Konietschke [aut]


Documentation:   PDF Manual  


GPL-3 license


Imports rankFD

Suggests testthat


See at CRAN