Learn R Programming

statpsych (version 2.0.0)

size.ci.ratio.prop2: Sample size for a 2-group proportion ratio confidence interval

Description

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.

For more details, see Section 2.22 of Bonett (2021, Volume 3)

Usage

size.ci.ratio.prop2(alpha, p1, p2, r, R)

Value

Returns the required sample size for each group

Arguments

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

References

Bonett2021statpsych

Examples

Run this code
size.ci.ratio.prop2(.05, .9, .7, 1.5, 1)

# Should return:
#   n1  n2
#   51  51

size.ci.ratio.prop2(.05, .9, .7, 1.5, .5)

# Should return:
#   n1  n2
#   91  46


Run the code above in your browser using DataLab