statsmodels.stats.proportion.proportion_confint(count, nobs, alpha=0.05, method='normal')
[source]
confidence interval for a binomial proportion
Parameters: 


Returns: 
ci_low, ci_upp – lower and upper confidence level with coverage (approximately) 1alpha. When a pandas object is returned, then the index is taken from the 
Return type: 
float, ndarray, or pandas Series or DataFrame 
Beta, the ClopperPearson exact interval has coverage at least 1alpha, but is in general conservative. Most of the other methods have average coverage equal to 1alpha, but will have smaller coverage in some cases.
The ‘beta’ and ‘jeffreys’ interval are central, they use alpha/2 in each tail, and alpha is not adjusted at the boundaries. In the extreme case when count
is zero or equal to nobs
, then the coverage will be only 1  alpha/2 in the case of ‘beta’.
The confidence intervals are clipped to be in the [0, 1] interval in the case of ‘normal’ and ‘agresti_coull’.
Method “binom_test” directly inverts the binomial test in scipy.stats. which has discrete steps.
http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval
© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.stats.proportion.proportion_confint.html