-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWMWssp.Rd
58 lines (44 loc) · 1.78 KB
/
WMWssp.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/samplesize.R
\name{WMWssp}
\alias{WMWssp}
\title{Sample size calculation for the Wilcoxon-Mann-Whitney test.}
\usage{
WMWssp(x, y, alpha = 0.05, power = 0.8, t = 1/2,
simulation = FALSE, nsim = 10^4)
}
\arguments{
\item{x}{prior information for the first group}
\item{y}{prior information for the second group}
\item{alpha}{two sided type I error rate}
\item{power}{power}
\item{t}{proportion of subjects in the first group; or use t = "min" to use optimal proportion rate}
\item{simulation}{TRUE if a power simulation should be carried out}
\item{nsim}{number of simulations for the power simulation}
}
\value{
Returns an object from class WMWssp containing
\item{result}{A dataframe with the results.}
\item{t}{The allocation rate which was used.}
\item{alpha}{The type-I error rate which was used.}
\item{simulation}{The achieved power in a simulation.}
\item{power}{The power which was used.}
\item{N}{The sample size needed.}
}
\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.
}
\examples{
# 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)
}
\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.
}
\keyword{export}