- statsmodels.stats.proportion.confint_proportions_2indep(count1, nobs1, count2, nobs2, method=None, compare='diff', alpha=0.05, correction=True)¶
Confidence intervals for comparing two independent proportions.
This assumes that we have two independent binomial samples.
- count1, nobs1
Count and sample size for first sample.
- count2, nobs2
Count and sample size for the second sample.
Method for computing confidence interval. If method is None, then a default method is used. The default might change as more methods are added.
in[‘diff’, ‘ratio’ ‘odds-ratio’]
If compare is diff, then the confidence interval is for diff = p1 - p2. If compare is ratio, then the confidence interval is for the risk ratio defined by ratio = p1 / p2. If compare is odds-ratio, then the confidence interval is for the odds-ratio defined by or = p1 / (1 - p1) / (p2 / (1 - p2).
Significance level for the confidence interval, default is 0.05. The nominal coverage probability is 1 - alpha.
- count1, nobs1
- Status: experimental, API and defaults might still change.
methodswill be added.
Fagerland, Morten W., Stian Lydersen, and Petter Laake. 2015. “Recommended Confidence Intervals for Two Independent Binomial Proportions.” Statistical Methods in Medical Research 24 (2): 224–54. https://doi.org/10.1177/0962280211415469.
Koopman, P. A. R. 1984. “Confidence Intervals for the Ratio of Two Binomial Proportions.” Biometrics 40 (2): 513–17. https://doi.org/10.2307/2531405.
Miettinen, Olli, and Markku Nurminen. “Comparative analysis of two rates.” Statistics in medicine 4, no. 2 (1985): 213-226.
Newcombe, Robert G. 1998. “Interval Estimation for the Difference between Independent Proportions: Comparison of Eleven Methods.” Statistics in Medicine 17 (8): 873–90. https://doi.org/10.1002/(SICI)1097-0258(19980430)17:8<873::AID- SIM779>3.0.CO;2-I.
Newcombe, Robert G., and Markku M. Nurminen. 2011. “In Defence of Score Intervals for Proportions and Their Differences.” Communications in Statistics - Theory and Methods 40 (7): 1271–82. https://doi.org/10.1080/03610920903576580.