- statsmodels.stats.proportion.multinomial_proportions_confint(counts, alpha=0.05, method='goodman')¶
Confidence intervals for multinomial proportions.
Array of [lower, upper] confidence levels for each category, such that overall coverage is (approximately) 1-alpha.
The goodman method  is based on approximating a statistic based on the multinomial as a chi-squared random variable. The usual recommendation is that this is valid if all the values in counts are greater than or equal to 5. There is no condition on the number of categories for this method.
The sison-glaz method  approximates the multinomial probabilities, and evaluates that with a maximum-likelihood estimator. The first approximation is an Edgeworth expansion that converges when the number of categories goes to infinity, and the maximum-likelihood estimator converges when the number of observations (
sum(counts)) goes to infinity. In their paper, Sison & Glaz demo their method with at least 7 categories, so
len(counts) >= 7with all values in counts at or above 5 can be used as a rule of thumb for the validity of this method. This method is less conservative than the goodman method (i.e. it will yield confidence intervals closer to the desired significance level), but produces confidence intervals of uniform width over all categories (except when the intervals reach 0 or 1, in which case they are truncated), which makes it most useful when proportions are of similar magnitude.
Levin, Bruce, “A representation for multinomial cumulative distribution functions,” The Annals of Statistics, Vol. 9, No. 5, 1981, pp. 1123-1126.
Goodman, L.A., “On simultaneous confidence intervals for multinomial proportions,” Technometrics, Vol. 7, No. 2, 1965, pp. 247-254.
Sison, Cristina P., and Joseph Glaz, “Simultaneous Confidence Intervals and Sample Size Determination for Multinomial Proportions,” Journal of the American Statistical Association, Vol. 90, No. 429, 1995, pp. 366-369.
May, Warren L., and William D. Johnson, “A SAS® macro for constructing simultaneous confidence intervals for multinomial proportions,” Computer methods and programs in Biomedicine, Vol. 53, No. 3, 1997, pp. 153-162.
May, Warren L., and William D. Johnson, “Constructing two-sided simultaneous confidence intervals for multinomial proportions for small counts in a large number of cells,” Journal of Statistical Software, Vol. 5, No. 6, 2000, pp. 1-24.