mqr.inference.proportion.

confint_1sample#

mqr.inference.proportion.confint_1sample(count, nobs, conf=0.95, bounded='both', method='agresti-coull')#

Confidence interval for proportion count / nobs.

Following [1], use the ‘wilson-cc’ or ‘jeffreys’ method for small sample size, and use the ‘agresti-coull’ or ‘jeffreys’ for larger sample sizes. The authors recommend n = 40 as the boundary between small and large.

Parameters:
countint

Number of “true” observations.

nobsint

Total observations.

conffloat, optional

Confidence level that determines the width of the interval.

bounded{‘both’, ‘below’, ‘above’}, optional

Which sides of the interval to close.

method{‘agresti-coull’, ‘jeffreys’, ‘wilson’, ‘wilson-cc’}, optional
‘agresti-coull’
Agresti-Coull interval, see [1].
‘jeffreys’
Jeffreys interval (a Bayesian method), see [1].
‘wilson’
Wilson method without continuity correction (method 3 in [2]).
‘wilson-cc’
Wilson method with continuity correction (method 4 in [2]).
(other)
Everything else is passed to sm..proportion_confint.
Returns:
mqr.inference.confint.ConfidenceInterval

References

[1] (1,2,3)

Brown, L. D. Cai, T. T. and DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101-133.

[2] (1,2)

Newcombe, R. G. (1998). Two‐sided confidence intervals for the single proportion: comparison of seven methods. Statistics in medicine, 17(8), 857-872.