size.ci.ratio.prop2 | R Documentation |
Computes the sample size in each group required to estimate a ratio of proportions with desired confidence interval precision in a 2-group design. Set R = 1 for equal sample sizes.
size.ci.ratio.prop2(alpha, p1, p2, r, R)
alpha |
alpha level for 1-alpha confidence |
p1 |
planning value of proportion for group 1 |
p2 |
planning value of proportion for group 2 |
r |
desired upper to lower confidence interval endpoint ratio |
R |
n2/n1 ratio |
Returns the required sample size for each group
size.ci.ratio.prop2(.05, .2, .1, 2, 1)
# Should return:
# n1 n2
# 416 416
size.ci.ratio.prop2(.05, .2, .1, 2, .5)
# Should return:
# n1 n2
# 704 352
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.