The Duality of Tests and Confidence Intervals
Hypothesis tests and confidence intervals are the same calculation viewed from two directions: a confidence interval is exactly the set of null values a test would fail to reject.
Prerequisites: Hypothesis Testing, Confidence Intervals
Textbooks teach hypothesis testing and confidence intervals as two separate techniques, with two separate sets of formulas to memorize. In fact they are the same underlying computation, read in two different directions. If you understand one, you already understand the other — you've just been looking at the same object from a different angle. Seeing this saves you from memorizing twice as many formulas as necessary, and it also explains why a "95% confidence interval that excludes zero" and "rejecting at the 5% level" are always, without exception, the same statement.
An analogy: a bouncer's guest list
Imagine a bouncer who tests, one name at a time, "would this specific name be allowed in tonight?" If you ask the bouncer about every possible name in the world, the ones that pass form a guest list — and that guest list is the confidence interval. Running a single hypothesis test is asking the bouncer about one particular name. Building the confidence interval is asking about every name and writing down who gets in. They are the same bouncer, doing the same check, just asked once versus asked for everyone.
The rule, one symbol at a time
Suppose for every candidate value you have a level- test of — a rule that rejects or fails to reject, controlling the false-rejection rate at . Define the set
In plain English: collect every candidate value that the test would let through, and call that collection your confidence set. The duality theorem says this is automatically a valid confidence interval — meaning it contains the true with probability across repeated sampling — precisely because each individual test controls its false-rejection rate at . Running the theorem backward: given a confidence interval, you can test any by simply checking whether falls inside the interval — reject if it doesn't, fail to reject if it does. Both directions are exactly equivalent; neither adds information the other lacks.
Slide a hypothesized across the horizontal axis of a curve like the one above, re-centered at your estimate. Every value that would sit inside the ordinary bulk of the curve fails to be rejected; sweeping across all of them traces out exactly the confidence interval.
"Reject at level " and " falls outside the confidence interval" are the same statement, always. Building a confidence interval is running infinitely many hypothesis tests at once and keeping the ones that pass.
Worked example 1: a t-test and a confidence interval agree
A sample of trade returns has mean and standard error . Test at (two-sided, using the normal approximation for simplicity). The test statistic is , and since , reject .
Now build the 95% confidence interval directly: , so the interval runs from to . Does it contain ? No — is well below . The interval excludes the null value exactly when the test rejects it. Same conclusion, same underlying arithmetic, two presentations.
Worked example 2: sweeping through candidate values by hand
Using the same , , test three different candidate null values directly, instead of building the interval formula: for , , and since , do NOT reject — so belongs in the confidence set. For , , and , so reject — is excluded. For , , and , so do NOT reject — belongs in the set. Notice these three verdicts ( in, out, in) are exactly consistent with the interval computed in Example 1, point by point, confirming the duality directly rather than by formula.
What this means in practice
- You only need to build one machine. Implement a valid hypothesis test once, and inverting it for every candidate value gives you a confidence interval for free — this is literally how software computes many nonstandard confidence intervals.
- Reading a report. If a paper reports "the 95% CI for alpha is [0.02, 0.09]," you already know that a test of at the 5% level rejects, without being told the test statistic at all.
- Asymmetric or irregular intervals. Because the duality holds test-by-test, it works even when the interval isn't a simple symmetric "estimate plus or minus," which is exactly how confidence intervals are built for skewed statistics like variances or odds ratios.
The equivalence holds only when the test and the interval are built from the same underlying method and same . A 95% confidence interval built one way and a hypothesis test built a different way (say, an exact test versus a normal approximation) can disagree at the margins even though both are individually valid — the duality is a property of a matched pair, not a universal law connecting any interval to any test.
Practice in interviews
Further reading
- Casella & Berger, Statistical Inference, sec. 9.2
- DeGroot & Schervish, Probability and Statistics, ch. 9