Computes the sample size in each group required to test a difference in population means with desired power in a 2-group design. Set R =1 for equal sample sizes. Set the variance planning value to the largest value within a plausible range for a conservatively large sample size.
size.test.mean2(alpha, pow, var, es, R)
alpha level for hypothesis test
desired power
planning value of average within-group variance
planning value of mean difference
n2/n1 ratio
Returns the required sample size for each group
size.test.mean2(.05, .95, 100, 10, 1)
#> n1 n2
#> 27 27
# Should return:
# n1 n2
# 27 27