size.test.prop2 | R Documentation |
Computes the sample size in each group required to test a difference in population proportions with desired power in a 2-group design. This function requires planning values for both proportions. Set the proportion planning values to .5 for a conservatively large sample size. The planning value for the effect size (proportion difference) could be set equal to the difference of the two proportion planning values or it could be set equal to a minimally interesting effect size.
size.test.prop2(alpha, pow, p1, p2, es)
alpha |
alpha level for hypothesis test |
pow |
desired power |
p1 |
planning value of proportion for group 1 |
p2 |
planning value of proportion for group 2 |
es |
planning value of proportion difference |
Returns the required sample size per group
size.test.prop2(.05, .8, .2, .4, .2)
# Should return:
# Sample size per group
# [1,] 79
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.