size.test.lc.mean.bs {statpsych} | R Documentation |
Computes the sample size in each group (assuming equal sample sizes) required to test a linear contrast of population means with desired power in a between-subjects design. Set the variance planning value to the largest value within a plausible range for a conservatively large sample size.
size.test.lc.mean.bs(alpha, pow, var, es, v)
alpha |
alpha level for hypothesis test |
pow |
desired power |
var |
planning value of average within-group variance |
es |
planning value of linear contrast of means |
v |
vector of between-subjects contrast coefficients |
Returns the required sample size per group
v <- c(1, -1, -1, 1) size.test.lc.mean.bs(.05, .90, 27.5, 5, v) # Should return: # Sample size per group # [1,] 47