WMWssp: Sample size calculation for the Wilcoxon-Mann-Whitney test.

Description Usage Arguments Value References Examples

View source: R/samplesize.R

Description

This function calculates the sample size for a given power, type-I error rate and allocation rate t = n_1/N. Additionally, the actual achieved power can be simulated.

Usage

1
2
WMWssp(x, y, alpha = 0.05, power = 0.8, t = 1/2,
  simulation = FALSE, nsim = 10^4)

Arguments

x

prior information for the first group

y

prior information for the second group

alpha

two sided type I error rate

power

power

t

proportion of subjects in the first group; or use t = "min" to use optimal proportion rate

simulation

TRUE if a power simulation should be carried out

nsim

number of simulations for the power simulation

Value

Returns an object from class WMWssp containing

result

A dataframe with the results.

t

The allocation rate which was used.

alpha

The type-I error rate which was used.

simulation

The achieved power in a simulation.

power

The power which was used.

N

The sample size needed.

References

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. (2019). Optimal Sample Size Planning for the Wilcoxon-Mann-Whitney-Test. Statistics in medicine, 38(3), 363-375.

Examples

1
2
3
4
5
6
7
8
# 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)

Example output

Wilcoxon-Mann-Whitney Sample Size Calculation
 
Summary
Call: WMWssp
Type-I error (two-sided): 0.05
Power: 0.8

                                 Results
alpha (2-sided)                0.0500000
Power                          0.8000000
Estimated relative effect p    0.3491124
N (total sample size needed) 111.3719511
t=n1/N                         0.5000000
n1 in Group 1                 55.6859755
n2 in Group 2                 55.6859755
N rounded                    112.0000000
n1 rounded                    56.0000000
n2 rounded                    56.0000000

WMWssp documentation built on July 9, 2019, 5:03 p.m.