WMWssp_maximize: Maximizing power for a given Type I error rate and prior...

Description Usage Arguments Value References Examples

View source: R/samplesize.R

Description

This function maximizes the power of the Wilcoxon-Mann-Whitney test for a given total sample size N and type-I error rate with respect to the allocation rate t = n_1/N.

Usage

1
WMWssp_maximize(x, y, alpha = 0.05, N)

Arguments

x

a vector of prior information for the first group

y

a vector of prior information for the second group

alpha

Type I error rate

N

total sample size

Value

Returns an object from class WMWssp containing

result

A dataframe with the results.

t

The optimal allocation rate.

alpha

The type-I error rate which was used.

power

The maximized power.

N

The total sample size which was used.

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
 9
10
11
# 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

#
N <- 112

# calculate optimal t
ssp <- WMWssp_maximize(x, y, alpha = 0.05, N)
summary(ssp)

Example output

Wilcoxon-Mann-Whitney Sample Size Calculation
 
Summary
Call: WMWssp_maximize
Type-I error (two-sided): 0.05
Sample size: 113

                      Results
optimal t           0.4964661
n1 in group 1      56.0000000
n2 i group 2       57.0000000
N rounded         113.0000000
Power               0.8023009
Power for t = 1/2   0.8022807

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