Problems with using a normal approximation or "Wald interval" {{anchor|Normal approximation interval|Wald interval}}
reveals problems of
overshoot and
zero-width intervals. 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 Using the normal approximation, the success probability \ p\ is estimated by p ~ \approx ~ \hat p \pm \frac{ z_\alpha }{ \sqrt{n\ } }\sqrt{ \hat p \left(1 - \hat p \right)\ }\ , where \ \hat p \equiv \frac{ n_\mathsf{s} }{ n }\ is the proportion of successes in a
Bernoulli trial process and an estimator for p in the underlying
Bernoulli distribution. The equivalent formula in terms of observation counts is p ~ \approx ~ \frac{ n_\mathsf{s} }{ n } \pm \frac{ z_\alpha }{ \sqrt{n\ } } \sqrt{ \frac{ n_\mathsf{s} }{ n } \frac{ n_\mathsf{f} }{ n }\ }\ , where the data are the results of \ n\ trials that yielded \ n_\mathsf{s}\ successes and \ n_\mathsf{f} = n - n_\mathsf{s}\ failures. The distribution function argument \ z_\alpha\ is the \ 1 - \tfrac{ \alpha }{2}\
quantile of a
standard normal distribution (i.e., the
probit) corresponding to the target error rate \ \alpha ~. For a 95% confidence level, the error \ \alpha ~=~ 1 - 0.95 ~=~ 0.05\ , so that \ 1 - \tfrac{ \alpha }{ 2 } = 0.975\ and \ z_{.05} = 1.96 ~. When using the Wald formula to estimate \ p\ , or just considering the possible outcomes of this calculation, two problems immediately become apparent: • First, for \ \hat p\ approaching either or , the interval narrows to zero width (falsely implying certainty). • Second, for values of \ \hat p (probability too low / too close to ), the interval boundaries exceed \ [0 , 1]\ (
overshoot). (Another version of the second, overshoot problem, arises when instead \ 1 - \hat p\ 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
-values if they were tested as a hypothesized
population proportion. The collection of values, \ \theta\ , for which the normal approximation is valid can be represented as \left\{\quad \theta \quad \Bigg\vert \quad y_{\alpha} ~ \le ~ \frac{\hat p - \theta}{\sqrt{\tfrac{ 1 }{ n }\ \hat p \left(1 - \hat p\right)\ } } ~ \le ~ z_{\alpha} \quad\right\}\ , where \ y_{\alpha}\ is the lower \ \tfrac{ \alpha }{ 2 }\
quantile of a
standard normal distribution, vs. \ z_{\alpha}\ , which is the
upper i.e., \ 1 - \tfrac{ \alpha }{ 2 }\ 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).
Bracketing the confidence interval Extending the normal approximation and Wald-Laplace interval concepts,
Michael Short has shown that inequalities on the
approximation error between the binomial distribution and the normal distribution can be used to accurately bracket the estimate of the confidence interval around \ p\ : \frac{ k + C_\mathsf{L1} - z_\alpha \widehat{W} }{ n + z_\alpha^2 } ~\le~ p ~\le~ \frac{ k + C_\mathsf{U1} + z_\alpha \widehat{W} }{ n + z_\alpha^2 } with \widehat{W} ~\equiv~ \sqrt{ \frac{ n k - k^2 + C_\mathsf{L2} n - C_\mathsf{L3} k + C_\mathsf{L4} }{ n }\ }\ , and where \ p\ is again the (unknown) proportion of successes in a Bernoulli trial process (as opposed to \ \hat p \equiv \frac{ n_\mathsf{s} }{ n }\ that estimates it) measured with \ n\ trials yielding \ k\ successes, \ z_\alpha\ is the \ 1 - \tfrac{\alpha}{2}\ quantile of a standard normal distribution (i.e., the probit) corresponding to the target error rate \ \alpha\ , and the constants \ C_\mathsf{L1}\ , C_\mathsf{L2}\ , \ C_\mathsf{L3}\ , \ C_\mathsf{L4}\ , \ C_\mathsf{U1}\ , \ C_\mathsf{U2}\ , \ C_\mathsf{U3}\ , and \ C_\mathsf{U4}\ are simple algebraic functions of \ z_\alpha ~. you are dealing with. For analytic weights, the following calculation can be applied. Let \ X_1,\ \ldots,\ X_n\ be such that each \ X_i\ is
i.i.d from a
Bernoulli( ) distribution and weight \ w_i\ is the weight for each observation, with the (positive) weights \ w_i\ normalized so they sum to The
weighted sample proportion is: \ \hat p = \sum_{i=1}^n w_i X_i ~. Since each of the \ X_i\ is independent from all the others, and each one has variance \ \operatorname{var}\{\ X_i\ \} = p \left(1 - p\right)\ for every \ i = 1 ,\ \ldots ,\ n\ ; the
sampling variance of the proportion therefore is: \operatorname{var}\left\{\ \hat p\ \right\} ~=~ \sum_{i=1}^n \operatorname{var}\left\{\ w_i X_i\ \right\} ~=~ p\left( 1 - p \right) \sum_{i=1}^n w_i^2 ~. The
standard error of \ \hat p\ is the
square root of this quantity. Because we do not know \ p \left(1 - p\right)\ , we have to estimate it. Although there are many possible estimators, a conventional one is to use \ \hat p\ , the sample mean, and plug this into the formula. That gives: \operatorname{SE}\left\{\ \hat p\ \right\} ~\approx~ \sqrt{ \hat p \left(1 - \hat p\right) \sum_{i=1}^n w_i^2 ~} ~. For otherwise unweighted data, the effective weights are uniform \ w_i = \frac{ 1 }{ n }\ , giving \ \sum_{i=1}^n w_i^2 = \frac{ 1 }{ n } ~. The \ \operatorname{SE}\ becomes \ \sqrt{ \tfrac{ 1 }{ n }\ \hat p \left( 1 - \hat p \right)\ }\ , 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==