dpropSampleSize: Difference in proportions sample size

Description Usage Arguments Value References Examples

Description

Calculate sample size (per group) needed to estimate a difference in proportions within a given margin of error. This function is derived from the classic approximate confidence interval formula for the difference in proportions (Hogg & Tanis, p. 383). The estimated sample size should be treated as a rough estimate.

Usage

1
dpropSampleSize(moe, p1 = 0.5, p2 = 0.5, conf = 0.95)

Arguments

moe

margin of error expressed as proportion (0 < moe < 1)

p1

estimated proportion in group 1 (default = 0.5)

p2

estimated proportion in group 2 (default = 0.5)

conf

confidence level associated with margin of error (default = 0.95)

Value

Estimated sample size for each group.

References

Hogg, R. V. and Tanis, E. A. (2006), Probability and Statistical Inference 7e, Pearson, New Jersey.

Examples

1
2
3
## Approximate sample size needed to estimate the difference in proportions between two
## binomial populations within 0.02, one with p = 0.11 and the other with p = 0.09.
dpropSampleSize(moe = 0.02, p1 = 0.11, p2 = 0.09)

clayford/nandc documentation built on May 13, 2019, 7:38 p.m.