size.test.lc.ancova | R Documentation |
Computes the sample size for each group (assuming equal sample sizes) required to test a linear contrast of population means in an ANCOVA model with desired power. In a nonexperimental design, the sample size is affected by the magnitude of covariate mean differences across groups. The covariate mean differences can be approximated by specifying the largest standardized covariate mean difference across all pairwise comparisons and for all covariates. In an experiment, this standardized mean difference is set to 0. Set the error variance planning value to the largest value within a plausible range for a conservatively large sample size.
size.test.lc.ancova(alpha, pow, evar, es, s, d, v)
alpha |
alpha level for hypothesis test |
pow |
desired power |
evar |
planning value of within-group (error) variance |
es |
planning value of linear contrast |
s |
number of covariates |
d |
largest standardized mean difference for all covariates |
v |
vector of between-subjects contrast coefficients |
Returns the required sample size for each group
v <- c(.5, .5, -1)
size.test.lc.ancova(.05, .9, 1.37, .7, 1, 0, v)
# Should return:
# Sample size per group
# 47
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.