| size.test.lc.mean.ws | R Documentation |
Computes the sample size required to test a linear contrast of population means with desired power in a within-subjects design. Set the average variance planning value to the largest value within a plausible range for a conservatively large sample size. Set the average correlation planning value to the smallest value within a plausible range for a conservatively large sample size.
For more details, see Section 4.27 of Bonett (2021, Volume 1)
size.test.lc.mean.ws(alpha, pow, var, es, cor, q)
alpha |
alpha level for hypothesis test |
pow |
desired power |
var |
planning value of average variance of measurements |
es |
planning value of linear contrast of means |
cor |
planning value of average correlation between measurements |
q |
vector of with-subjects contrast coefficients |
Returns the required sample size
Bonett2021statpsych
q <- c(1, -1, -1, 1)
size.test.lc.mean.ws(.05, .95, 15.0, 3, .8, q)
# Should return:
# Sample size
# 20
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.