14,443
edits
(add equivalent formulas for normal approx. and Wilson score intervals obtained by multiplying the nominator and denominator by n, as these are often more computationally convenient; edit description to introduce n_S = np and n_F = n(1p)) 

The approximation is usually justified by the [[central limit theorem]]. The formula is
: <math>\hat p \pm
or, equivalently
where <math>\hat p</math> is the proportion of successes in a [[Bernoulli trial]] process estimated from the statistical sample, <math>z</math> is the <math>\scriptstyle 1  \frac{1}{2}\alpha</math> [[quantile]] of a [[standard normal distribution]], <math>\alpha</math> is the error quantile and ''n'' is the sample size. For example, for a 95% confidence level the error (<math>\alpha</math>) is 5%, so <math>\scriptstyle 1  \frac{1}{2}\alpha</math> = 0.975 and <math>z</math> = 1.96.▼
: <math>\frac{1}{n} \left[ n_S \pm z \sqrt{\frac{1}{n} n_S n_F} \right]</math>
The [[central limit theorem]] applies poorly to this distribution with a sample size less than 30 or where the proportion is close to 0 or 1. The normal approximation fails totally when the sample proportion is exactly zero or exactly one. A frequently cited rule of thumb is that the normal approximation is a reasonable one as long as ''np'' > 5 and ''n''(1 − ''p'') > 5, however even this is unreliable in many cases; see Brown et al. 2001.<ref name=Brown2001>▼
▲where <math>\hat p = n_S / n</math> is the proportion of successes in a [[Bernoulli trial]] process
▲The [[central limit theorem]] applies poorly to this distribution with a sample size less than 30 or where the proportion is close to 0 or 1. The normal approximation fails totally when the sample proportion is exactly zero or exactly one. A frequently cited rule of thumb is that the normal approximation is a reasonable one as long as
{{Cite journal
 last1 = Brown
: <math>\left\{ \theta \bigg y \le \frac{\hat p  \theta}{\sqrt{\frac{1}{n}\hat p \left(1  \hat p\right)}} \le z \right\}</math>
where <math>y</math> is the <math>\
Since the test in the middle of the inequality is a [[Wald test]], the normal approximation interval is sometimes called the [[Abraham WaldWald]] interval, but [[PierreSimon Laplace]] first described it in his 1812 book ''Théorie analytique des probabilités'' (page 283).
}
\right]
</math>
or, equivalently
:<math>
\frac{1}{n + z^2}
\left[
n_S + \frac{1}{2} z^2 \pm
z \sqrt{
\frac{1}{n} n_S n_F +
\frac{1}{4}z^2
}
\right]
</math>
</math>
can be shown to be a weighted average of <math>\hat{p} = \
===Wilson score interval with continuity correction===
