The function propdiff.freq returns the required sample sizes to obtain a confidence interval of given length and confidence level for the difference between two binomial proportions.
propdiff.freq(len, p1.estimate, p2.estimate, level = 0.95)The required sample sizes (n1, n2) for each group given the inputs to the function.
The desired total length of the confidence interval for the proportion
A point estimate for the binomial proportion for the first population
A point estimate for the binomial proportion for the second population
The desired level of the confidence interval (e.g., 0.95)
Lawrence Joseph lawrence.joseph@mcgill.ca, Patrick Bélisle and Roxane du Berger
Assume that a random sample from each of two populations will be
collected in order to estimate the difference between two independent binomial proportions.
Assume that the best point estimates for the unknown binomial proportions in the two populations are (p1.estimate, p2.estimate), respectively.
The function propdiff.freq returns the required sample sizes to attain the
desired length len and confidence level level for the confidence interval
for the difference between the two unknown proportions from a frequentist point of view, using a normal approximation.
Lemeshow S, Hosmer Jr DW, Klar J, Lwanga SK.
Adequacy of Sample Size in Health Studies. Wiley and Sons, New York, 1990.
Joseph L, du Berger R, and Bélisle P.
Bayesian and mixed Bayesian/likelihood criteria for sample size determination
Statistics in Medicine 1997;16(7):769-781.
propdiff.acc, propdiff.modwoc, propdiff.woc, propdiff.mblacc, propdiff.mblalc, propdiff.mblmodwoc, propdiff.mblwoc
propdiff.freq(len=0.01, p1.estimate=0.15, p2.estimate=0.20)Run the code above in your browser using DataLab