getSampleSizeMeans {rpact}  R Documentation 
Returns the sample size for testing means in one or two samples.
getSampleSizeMeans(design = NULL, ..., groups = 2, normalApproximation = FALSE, meanRatio = FALSE, thetaH0 = ifelse(meanRatio, 1, 0), alternative = C_ALTERNATIVE_DEFAULT, stDev = C_STDEV_DEFAULT, allocationRatioPlanned = NA_real_)
design 
The trial design. If no trial design is specified, a fixed sample size design is used.
In this case, 
... 
Ensures that all arguments are be named and that a warning will be displayed if unknown arguments are passed. 
groups 
The number of treatment groups (1 or 2), default is 
normalApproximation 
If 
meanRatio 
If 
thetaH0 
The null hypothesis value. For onesided testing, a value != 0
(or a value != 1 for testing the mean ratio) can be specified, default is

alternative 
The alternative hypothesis value. This can be a vector of assumed
alternatives, default is 
stDev 
The standard deviation, default is 1. If 
allocationRatioPlanned 
The planned allocation ratio for a two treatment groups
design, default is 1. If 
At given design the function calculates the stagewise (noncumulated) and maximum sample size for testing means. In a two treatment groups design, additionally, an allocation ratio = n1/n2 can be specified. A null hypothesis value thetaH0 != 0 for testing the difference of two means or thetaH0 != 1 for testing the ratio of two means can be specified. Critical bounds and stopping for futility bounds are provided at the effect scale (mean, mean difference, or mean ratio, respectively) for each sample size calculation separately.
Returns a TrialDesignPlanMeans
object.
# Calculate sample sizes in a fixed sample size parallel group design # with allocation ratio n1/n2 = 2 for a range of alternative values 1,...,5 # with assumed standard deviation = 3.5; twosided alpha = 0.05, power 1  beta = 90%: getSampleSizeMeans(alpha = 0.05, beta = 0.1, sided = 2, groups = 2, alternative = seq(1, 5, 1), stDev = 3.5, allocationRatioPlanned = 2) # Calculate sample sizes in a threestage Pocock paired comparison design testing # H0: mu = 2 for a range of alternative values 3,4,5 with assumed standard # deviation = 3.5; onesided alpha = 0.05, power 1  beta = 90%: getSampleSizeMeans(getDesignGroupSequential(typeOfDesign = "P", alpha = 0.05, sided = 1, beta = 0.1), groups = 1, thetaH0 = 2, alternative = seq(3, 5, 1), stDev = 3.5)