Confidence Intervals and Test Assumptions › The Remarkable Equivalence
Machine Learning from ScratchAll chapters Confidence Intervals and Test Assumptions › The Remarkable EquivalenceOne section · Sections in this chapter3 / 9 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Here's the key insight that connects confidence intervals to hypothesis testing: a 95% confidence interval contains exactly those parameter values that would NOT be rejected by a two-sided hypothesis test at the 0.05 significance level.
Why the Equivalence Holds
Let's prove this algebraically. Consider testing versus at significance level .
We reject when the test statistic exceeds the critical value:
Rearranging this inequality:
The last line says: we reject when falls outside the interval .
But this interval is exactly the 95% confidence interval! So:
- inside the CI hypothesis test fails to reject
- outside the CI hypothesis test rejects
The confidence interval is the set of all parameter values that would not be rejected as null hypotheses.
Visualizing the Equivalence

Why This Matters Practically
This equivalence has important practical implications:
-
Confidence intervals are more informative than p-values. A p-value tells you whether one specific null hypothesis is rejected. A confidence interval tells you which values would be rejected and which wouldn't. It's like the difference between asking "Is the speed limit 65 mph?" versus "What range of speed limits are consistent with my speedometer reading?"
-
You can read significance from a CI. If a 95% CI for a difference doesn't include zero, the difference is significant at the 0.05 level. If the CI for a ratio doesn't include 1, the ratio is significant. You don't need to compute a separate test.
-
CIs convey precision. A CI of [0.1, 0.3] and a CI of [-2, 5] might both exclude zero (both "significant"), but the first shows you know the effect is small and positive, while the second shows you barely know anything at all.
