WMWssp_minimize: Minimizing samplesize for a given Type I and II error rate...

Description Usage Arguments Value References Examples

View source: R/samplesize.R

Description

This function minimizes the sample size for a given power and type-I error rate with respect to the allocation rate t = n_1/N.

Usage

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

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

power

Power to detect a relative effect based on the prior information

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 optimal allocation rate for minimizing the sample size.

alpha

The type-I error rate which was used.

power

The power which was used.

N

The minimized sample size.

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 optimal t
ssp <- WMWssp_minimize(x, y, alpha = 0.05, power = 0.8)
summary(ssp)

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