size.test.lc.prop.bs | R Documentation |
Computes the sample size in each group (assuming equal sample sizes) required to test a linear contrast of population proportions with desired power in a between-subjects design. This function requires planning values for all proportions. Set the proportion planning values to .5 for a conservatively large sample size. The planning value for the effect size (linear contrast of proportions) could be set equal to the linear contrast of proportion planning values or it could be set equal to a minimally interesting effect size.
size.test.lc.prop.bs(alpha, pow, p, es, v)
alpha |
alpha level for hypothesis test |
pow |
desired power |
p |
vector of proportion planning values |
es |
planning value of proportion linear contrast |
v |
vector of between-subjects contrast coefficients |
Returns the required sample size for each group
p <- c(.25, .30, .50, .50)
v <- c(.5, .5, -.5, -.5)
size.test.lc.prop.bs(.05, .9, p, .15, v)
# Should return:
# Sample size per group
# 105
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.