↑ arvau

Wikipedia / Binomial proportion confidence interval

In statistics, a binomial proportion confidence interval is a confidence interval for the probability of success calculated from the outcome of a series of success–failure experiments (Bernoulli trials are known.

There are several formulas for a binomial confidence interval, but all of them rely on the assumption of a binomial distribution. In general, a binomial distribution applies when an experiment is repeated a fixed number of times, each trial of the experiment has two possible outcomes (success and failure), the probability of success is the same for each trial, and the trials are statistically independent. Because the binomial distribution is a discrete probability distribution (i.e., not continuous) and difficult to calculate for large numbers of trials, a variety of approximations are used to calculate this confidence interval, all with their own tradeoffs in accuracy and computational intensity.

A simple example of a binomial distribution is the set of various possible outcomes, and their probabilities, for the number of heads observed when a coin is flipped ten times. The observed binomial proportion is the fraction of the flips that turn out to be heads. Given this observed proportion, the confidence interval for the true probability of the coin landing on heads is a range of possible proportions, which may or may not contain the true proportion. A 95% confidence interval for the proportion, for instance, will contain the true proportion 95% of the times that the procedure for constructing the confidence interval is employed.

Problems with using a normal approximation or "Wald interval" Normal approximation intervalWald interval

with a normal distribution. The normal approximation depends on the de Moivre–Laplace theorem (the original, binomial-only version of the central limit theorem) and becomes unreliable when it violates the theorems' premises, as the sample size becomes small or the success probability grows close to either or

is estimated by

is the proportion of successes in a Bernoulli trial in the underlying Bernoulli distribution. The equivalent formula in terms of observation counts is

quantile of a standard normal distribution (i.e., the probit

or just considering the possible outcomes of this calculation, two problems immediately become apparent:

  • approaching either or , the interval narrows to zero width (falsely implying certainty).

  • (probability too low / too close to (overshoot).

falls below the same upper bound: probability too high / too close to .)

An important theoretical derivation of this confidence interval involves the inversion of a hypothesis test. Under this formulation, the confidence interval represents those values of the population parameter that would have large p-values if they were tested as a hypothesized population proportion. for which the normal approximation is valid can be represented as

quantile of a standard normal distribution which is the upper quantile.

Since the test in the middle of the inequality is a Wald test, the normal approximation interval is sometimes called the Wald interval or Wald method, after Abraham Wald, but it was first described by Laplace (1812).

Standard error of a proportion estimation when using weighted data

To apply the principles of the weighted data correctly, you need to understand the type of the weight you are dealing with. For analytic weights, the following calculation can be applied.

is i.i.d from a Bernoulli( normalized so they sum to The weighted sample proportion the sampling variance of the proportion therefore is:

The standard error is the square root the sample mean, and plug this into the formula. That gives:

leading to the familiar formulas, showing that the calculation for weighted data is a direct generalization of them.

If the weights in question are the complex sampling design weights, appropriate statistical software (R package ; Python package ) needs to be used to obtain standard errors corrected for the survey sampling design. An extension of the presented below to the complex survey data is also known as the Korn-Graubard confidence interval.

Wilson score interval

The Wilson score interval was developed by E.B. Wilson (1927). It is an improvement over the normal approximation interval in multiple respects: Unlike the symmetric normal approximation interval (above), the Wilson score interval is asymmetric, and it doesn't suffer from problems of overshoot and zero-width intervals that afflict the normal interval. It can be safely employed with small samples and skewed observations. The observed coverage probability.

Like the normal interval, the interval can be computed directly from a formula.

The analytic formula for a binomial sample standard deviation Transforming the relation into a standard-form quadratic equation

is an abbreviation for

receiving greater weight as the sample size increases. Formally, the center value corresponds to using a pseudocount the number of standard deviations of the confidence interval: Add this number to both the count of successes and of failures to yield the estimate of the ratio. For the common two standard deviations in each direction interval (approximately 95% coverage, which itself is approximately 1.96 which is known as the "plus four rule".

Although the quadratic can be solved explicitly, in most cases Wilson's equations can also be solved numerically using the fixed-point iteration

The Wilson interval can also be derived from the single sample z-test or Pearson's chi-squared test with two categories. The resulting interval,

to produce the Wilson score interval. The test in the middle of the inequality is a score test.

The interval equality principle

has the property of being guaranteed to obtain the same result as the equivalent z-test or chi-squared test.

This property can be visualised by plotting the probability density function for the Wilson score interval (see Wallis). After that, then also plotting a normal across each bound. The tail areas of the resulting Wilson and normal distributions represent the chance of a significant result, in that direction, must be equal.

The continuity-corrected Wilson score interval and the Clopper-Pearson interval are also compliant with this property. The practical import is that these intervals may be employed as significance tests, with identical results to the source test, and new tests may be derived by geometry.

Wilson score interval with continuity correction

The Wilson interval may be modified by employing a continuity correction, in order to align the minimum coverage probability

Just as the Wilson interval mirrors Pearson's chi-squared test, the Wilson interval with continuity correction mirrors the equivalent Yates' chi-squared test.

are derived from Newcombe:

Wallis (2026) identifies a simpler method for computing continuity-corrected Wilson intervals that employs a special functionThis method has the advantage of being further decomposable.

To apply a continuity correction unaltered (Wallis 2026).

Wilson interval with complex survey data

that accounts for the design effect of sampling.

is the sampling design degrees of freedom.

Jeffreys interval

The Jeffreys interval has a Bayesian derivation, but good frequentist properties (outperforming most frequentist constructions). In particular, it has coverage properties that are similar to those of the Wilson interval, but it is one of the few intervals with the advantage of being equal-tailed (e.g., for a 95% confidence interval, the probabilities of the interval lying above or below the true value are both close to 2.5%). In contrast, the Wilson interval has a systematic bias such that it is centred too close to

The Jeffreys interval is the Bayesian credible interval obtained when using the non-informative Jeffreys prior The Jeffreys prior for this problem is a Beta distribution a conjugate prior trials, the posterior distribution

or the upper limit is calculated as before but the lower limit is set to the lower limit is calculated as before but the upper limit is set to .

Jeffreys' interval can also be thought of as a frequentist interval based on inverting the p-value from the G-test after applying the Yates correction to avoid a potentially-infinite value for the test statistic.

Clopper–Pearson interval

The Clopper–Pearson interval is an early and very common method for calculating binomial confidence intervals. This is often called an 'exact' method, as it attains the nominal coverage level in an exact sense, meaning that the coverage level is never less than the nominal

The Clopper–Pearson interval can be written as

or equivalently,

with

  1. H0 with HA

  2. H0 with HA

Because of a relationship between the binomial distribution and the beta distribution, the Clopper–Pearson interval is sometimes presented in an alternate format that uses quantiles from the beta distribution.

is the th quantile

as follows from the relation between the Binomial distribution cumulative distribution function and the regularized incomplete beta function.

is either

The beta distribution is, in turn, related to the F-distribution so a third formulation of the Clopper–Pearson interval can be written using F quantiles:

quantile from an F-distribution degrees of freedom.

i.e., the normal approximation (or "standard") interval, Wilson interval, Agresti–Coull interval, etc., with a nominal coverage of 95% may in fact cover less than 95%, even for large sample sizes.

The definition of the Clopper–Pearson interval can also be modified to obtain exact confidence intervals for different distributions. For instance, it can also be applied to the case where the samples are drawn without replacement from a population of a known size, instead of repeated draws of a binomial distribution. In this case, the underlying distribution would be the hypergeometric distribution.

The interval boundaries can be computed with numerical functions in R and scipy.stats.beta.ppf in Python.

Agresti–Coull interval

The Agresti–Coull interval is also another approximate binomial confidence interval.

is given by

). According to Brown, Cai, & DasGupta (2001), instead of 1.96 produces the "add 2 successes and 2 failures" interval previously described by Agresti & Coull.

of the Wilson score interval, and then applying the Normal approximation to this point.

Arcsine transformation

The arcsine transformation has the effect of pulling out the ends of the distribution. While it can stabilize the variance (and thus confidence intervals) of proportion data, its use has been criticized in several contexts.

is

Using the arc sine is

So, the confidence interval itself has the form

quantile of a standard normal distribution.

is close to or .

ta transform

This family is a generalisation of the logit transform which is a special case with a = 1 and can be used to transform a proportional data distribution to an approximately normal distribution. The parameter a has to be estimated for the data set.

Rule of three — for when no successes are observed

The rule of three) have been observed..

.

Comparison and discussion

There are several research papers that compare these and other confidence intervals for the binomial proportion.

Both Ross (2003) and Agresti & Coull (1998) point out that exact methods such as the Clopper–Pearson interval may not work as well as some approximations. The normal approximation interval and its presentation in textbooks has been heavily criticised, with many statisticians advocating that it not be used. The principal problems are overshoot (bounds exceed ), zero-width intervals or (falsely implying certainty),, inaccurate coverage (the actual coverage is not equal to the nominal level such as 95%) and overall inconsistency with significance testing.

Of the approximations listed above, Wilson score interval methods (with or without continuity correction) have been shown to be the most accurate and the most robust, though some prefer Agresti & Coull's approach for larger sample sizes. Wilson and Clopper–Pearson methods obtain consistent results with source significance tests, and this property is decisive for many researchers.

Many of these intervals can be calculated in R using packages like and ; and in Python using function

See also

References