Abstract
When collecting or analyzing data it is important to know how much data will be needed to allow detection of specific differences which are of interest. Since this problem comes up very often, we offer a note on how to find the required sample size N needed to detect a difference in proportions
(p1 - p2) of two groups, as a function of the size (α) and the power (β) of the test. We provide an R function to compute N with continuity correction.
We discuss well known techniques for the determining the sample sizes needed to allow us to detect differences between two specified proportions described by Fliess[1]. We also show the continuity correction of Kramer and Greenhouse [2].
See the PDF on the for derivations and R source code for the computations.
[1] Determining Sample Sizes Needed to Detect a Difference Between Two Proportions, Chapter 2 of Statistical Methods for Rates and Proportions. Joseph L. Fleiss, John Wiley & Sons, New York, 1973.
[2] Determination of sample size and selection of cases. M. Kramer and S. Greenhouse. NAS/NRC publication 583, p. 356-371, Psychopharmacology: Problems in Evaluation. Washington D.C.
Comentarios