Why Interval Choice Matters for Allele Frequencies
An estimated allele frequency is based on a finite number of observed allele copies. Even if the sampled copies are representative, a different sample could produce a different count. A confidence interval expresses the resulting sampling uncertainty. The choice of interval matters: when an allele is rare, or when its observed count is zero, the familiar normal approximation can give misleading results, including an interval with a negative lower endpoint or no width at all.
This tutorial considers Wilson score and exact binomial intervals. Both respect the boundaries of a frequency, which must lie between zero and one. They differ in how they are constructed: Wilson intervals invert a score test, while exact intervals use binomial tail probabilities. Neither removes uncertainty from an unrepresentative sample or from a sampling model that does not fit the data.
Allele Counts and the Binomial Model
For \(n\) fully genotyped diploid individuals at an autosomal locus, \(N=2n\) allele copies are observed. More generally, \(N\) is the number of observed copies under the ploidy and call-counting scheme used. The binomial model requires more than a large number of copies: it assumes independent sampling with a common frequency. For example, the assumption may be questionable when sampled individuals are related or when copies within individuals are dependent. The intervals below describe uncertainty under the stated model; they do not correct violations of it.
A confidence level of \(1-\alpha\) describes the long-run coverage of the interval procedure. If the same sampling process were repeated many times and an interval calculated each time, a 95% procedure would contain the fixed frequency \(p\) in about 95% of repetitions (with the exact procedure having coverage at least 95%). It does not mean that, after observing the data, there is a 95% probability that this particular interval contains a fixed \(p\).
The Wilson Score Interval
The Wilson interval is obtained by asking which candidate frequencies \(p_0\) would not be rejected by a two-sided score test at level \(\alpha\). Let \(z=z_{1-\alpha/2}\) be the corresponding standard normal critical value; for a 95% interval, \(z\approx1.96\). The Wilson endpoints can be written directly in terms of \(\hat{p}\) and \(N\):
The endpoints are already between zero and one for \(0\leq\hat{p}\leq1\). Unlike the Wald interval, which substitutes \(\hat{p}\) into the standard error and centers the interval at \(\hat{p}\), Wilson’s construction accounts for the uncertainty in the candidate frequency being tested. Its center need not equal \(\hat{p}\).
Worked Example: A Common Allele
Suppose a hypothetical sample has \(N=200\) allele copies, of which \(X=80\) carry the allele of interest. Under the binomial model, \(\hat{p}=80/200=0.400\). Construct a 95% Wilson interval using \(z=1.96\).
Here \(z^2=3.8416\), and the denominator is \(1+3.8416/200=1.019208\). The center numerator is \(0.400+3.8416/400=0.409604\). The square-root term is \[ \sqrt{\frac{0.400(0.600)}{200}+\frac{3.8416}{4(200)^2}} =\sqrt{0.00122401}\approx0.034986. \]
Thus the lower endpoint is \((0.409604-1.96(0.034986))/1.019208\approx0.3346\), and the upper endpoint is \((0.409604+1.96(0.034986))/1.019208\approx0.4692\). The 95% Wilson interval is approximately 0.335 to 0.469. In context, it is an interval for the population frequency of this allele under the binomial sampling model, not a statement that the frequency is random with a 95% probability of lying in these observed bounds.
Why the Wilson Formula Has This Form
For a candidate frequency \(p_0\), the binomial score statistic standardizes the difference between \(\hat{p}\) and \(p_0\) using the standard error calculated under \(p_0\). Inverting the two-sided score test means retaining all \(p_0\) satisfying the following inequality:
Squaring both sides and multiplying by the positive denominator gives \(N(\hat{p}-p_0)^2\leq z^2p_0(1-p_0)\). Collecting terms yields a quadratic inequality:
The retained values of \(p_0\) lie between the two roots. Applying the quadratic formula and dividing numerator and denominator by \(2N\) gives the Wilson endpoints above. This inversion explains why the method is called a score interval and why it remains informative at a boundary: it tests candidate frequencies using their own binomial standard errors, rather than treating an observed boundary estimate as if its estimated standard error were reliable.
Worked Example: A Rare Allele
In a second hypothetical sample, \(N=200\) copies contain \(X=2\) copies of the allele. The estimate is \(\hat{p}=2/200=0.0100\). For a 95% Wilson interval, the denominator is again \(1.019208\), and the center numerator is \(0.0100+3.8416/400=0.019604\).
The square-root term is \[ \sqrt{\frac{0.0100(0.9900)}{200}+\frac{3.8416}{4(200)^2}} =\sqrt{0.00007351}\approx0.008574. \]
The lower endpoint is \((0.019604-1.96(0.008574))/1.019208\approx0.00275\). The upper endpoint is \((0.019604+1.96(0.008574))/1.019208\approx0.0357\). The interval is approximately 0.00275 to 0.0357. Although only 2 of 200 copies carried the allele, the interval shows substantial relative uncertainty: frequencies several times the point estimate remain compatible with the data under this procedure.
The Exact Binomial Interval
The Clopper–Pearson exact interval uses binomial probabilities to set its tails. For a two-sided \(1-\alpha\) interval and an observed count \(X=x\), each tail has probability \(\alpha/2\). For \(0<x<N\), its lower endpoint \(L\) and upper endpoint \(U\) are defined by \(P_{p=L}(X\geq x)=\alpha/2\) and \(P_{p=U}(X\leq x)=\alpha/2\), respectively. Equivalently, these are beta-distribution quantiles:
Here \(Q_q\{\operatorname{Beta}(a,b)\}\) denotes the \(q\) quantile of a beta distribution with shape parameters \(a\) and \(b\). At the boundaries, define \(L=0\) when \(x=0\), and \(U=1\) when \(x=N\); the other endpoint is found from the corresponding binomial tail equation. The exact interval is called exact because its coverage is at least the stated level for every possible \(p\) under the binomial model. Since a binomial count is discrete, its coverage is generally not exactly \(1-\alpha\) at every \(p\); it can be greater, making the procedure conservative.
Worked Example: Zero Copies Observed
Suppose a hypothetical sample contains \(N=20\) allele copies and none carries the allele, so \(X=0\) and \(\hat{p}=0\). For a 95% exact interval, the lower endpoint is zero. The upper endpoint \(U\) solves \(P_U(X\leq0)=0.025\). Since \(P_U(X=0)=(1-U)^{20}\), the equation and solution are \[ (1-U)^{20}=0.025,\qquad U=1-(0.025)^{1/20}\approx0.1684. \]
The exact interval is therefore 0 to 0.1684. Observing no copies does not establish that the population frequency is zero; the sample is also compatible with nonzero frequencies under this interval procedure. The upper limit is wide because only 20 copies were sampled.
Boundary Behavior and the Normal Approximation
A commonly used Wald, or normal-approximation, interval is \(\hat{p}\pm z\sqrt{\hat{p}(1-\hat{p})/N}\). It is centered at the estimate and estimates its standard error by substituting \(\hat{p}\) for the unknown \(p\). This can work as a rough approximation when the count and the number of non-carrier copies are both sufficiently large. It can perform poorly when either is small, because the binomial distribution is discrete and skewed near zero or one.
At \(X=0\), the Wald standard error is zero, so the interval collapses to \([0,0]\), regardless of how small \(N\) is. That falsely suggests no sampling uncertainty. At small positive counts, the Wald lower endpoint can be negative, even though a frequency cannot be negative, and its coverage can be poor. Truncating a Wald interval at zero does not repair the underlying coverage problem.
Worked Example: Comparing Boundary Intervals
Return to the hypothetical sample with \(N=20\) and \(X=0\). The Wald interval has estimate \(\hat{p}=0/20=0\) and estimated standard error \(\sqrt{0(1-0)/20}=0\). Its 95% interval is \(0\pm1.96(0)=[0,0]\).
For the Wilson interval, the lower endpoint is zero and the upper endpoint simplifies at \(\hat{p}=0\) to \(z^2/(N+z^2)\). Therefore, \[ U=\frac{3.8416}{20+3.8416}\approx0.1611, \] giving a Wilson interval of 0 to 0.1611. The exact interval calculated above is 0 to 0.1684. Both alternatives reflect uncertainty that the Wald interval misses. Their different upper limits arise from their different constructions: Wilson inverts a score test, while the exact interval controls binomial tail probabilities.
| Method | Construction | Boundary and small-count behavior |
|---|---|---|
| Wald (normal approximation) | Estimate plus or minus a normal critical value times the estimated standard error | May extend beyond zero or one; at zero observed copies it has zero width |
| Wilson score | Inverts a score test using candidate-frequency standard errors | Stays within zero and one and remains informative at a boundary |
| Clopper–Pearson exact | Inverts binomial tail probabilities | Stays within zero and one and has coverage at least the nominal level, often at the cost of a wider interval |
Choosing and Reporting an Interval
For routine binomial allele counts, Wilson intervals are often a useful default: they respect the parameter bounds and generally avoid the most conspicuous boundary failures of the Wald method. Exact intervals are useful when strict coverage control under the binomial model is a priority, especially for very small counts. Their conservatism can make them wider than necessary for some parameter values. The Wald interval should not be relied on merely because a formula is familiar; check whether both the allele count and its complement are large enough for a normal approximation to be credible.
Report the count and denominator alongside the estimate and interval. For example, “2 of 200 allele copies carried the allele (\(\hat{p}=0.0100\)); the 95% Wilson interval was 0.00275 to 0.0357.” This makes clear what was counted and which method was used. State the interval method and the assumed sampling model, particularly when comparing estimates from different samples.
- Common mistake: “No copies were observed, so the allele frequency is zero.” The observation gives \(\hat{p}=0\), not proof that the population frequency is zero. An interval such as the Wilson or exact interval retains plausible positive frequencies.
- Common mistake: “The exact interval is always exactly 95%.” Because counts are discrete, its coverage is at least 95% and may exceed 95%.
- Common mistake: “A confidence interval fixes relatedness or nonrepresentative sampling.” These intervals quantify uncertainty under the binomial model; they do not make dependent copies independent or make a biased sample representative.
Check Your Understanding
Use the binomial sampling model and interval definitions above to answer the following questions.
- A sample has \(N=100\) allele copies and \(X=5\) copies of the allele. What is \(\hat{p}\), and which interval methods discussed here are designed to respect the frequency boundaries?
- Why does a Wald interval have zero width when no copies of the allele are observed?
- In a two-sided exact 95% interval with \(X=0\), what binomial probability equation determines the upper endpoint?
- What does the “at least 95% coverage” guarantee mean for the Clopper–Pearson procedure, and why may its actual coverage exceed 95%?
- Name one sampling condition required by the binomial model and explain why a confidence-interval formula cannot compensate if that condition fails.