Confidence Intervals
Why It Matters
Point estimates hide how uncertain that estimate is. A confidence interval provides a range of plausible values for an unknown population parameter, along with a measure of how confident we are that the interval captures the true value. Without CIs, every estimate looks equally trustworthy, whether it comes from 5 samples or 5,000. Confidence intervals are the backbone of scientific reporting, clinical trials, political polling, and A/B testing. Every time you read "the effect was 3.2% with a 95% CI of [1.1%, 5.3%]", you are seeing a confidence interval at work.
Overview
A confidence interval is a range computed from sample data such that, before observing data, . After observing data, we compute specific bounds and say we are confident the interval contains . The general structure is point estimate ± critical value × standard error. For means with known , use the z-interval. When is unknown (almost always), use the t-interval which has heavier tails reflecting the additional uncertainty from estimating . For proportions, the Wilson score interval is preferred over the basic Wald interval, especially when is near 0 or 1. Bootstrap CIs make no distributional assumptions and work for any statistic.
Key Concepts
General CI Structure
Here,
- =Best guess for the parameter (e.g., sample mean)
- =z-score or t-score for the desired confidence level
- =Estimated standard deviation of the point estimate
Z-Interval (Known σ)
Here,
- =Sample mean (point estimate of μ)
- =Critical value from standard Normal distribution
- =Known population standard deviation
- =Sample size
T-Interval (Unknown σ)
Here,
- =Critical t-value with n-1 degrees of freedom
- =Sample standard deviation (estimates σ)
CI for Proportion
Here,
- =Sample proportion
- =Sample size
Margin of Error
Here,
- =Half-width of the CI; maximum expected difference
Sample Size for Desired ME
Here,
- =Desired margin of error
Common Critical Values
| Confidence Level | |||
|---|---|---|---|
| 90% | 0.10 | 1.645 | 1.697 |
| 95% | 0.05 | 1.960 | 2.042 |
| 99% | 0.01 | 2.576 | 2.750 |
Factors Affecting CI Width
| Factor | Effect on Width | Reason |
|---|---|---|
| Higher confidence level | Wider | Must cover more of the sampling distribution |
| Larger sample size | Narrower | Standard error decreases as |
| Larger variability | Wider | More uncertainty about the parameter |
Quick Example
T-Interval: Clinical Trial
A drug trial measures blood pressure reduction in 25 patients: mmHg, mmHg. 95% CI with , :
Since the entire interval is positive, the drug appears effective. If the interval included zero, we could not conclude the drug works.
Election Poll CI
Poll of 1,200 voters: 648 support Candidate A. .
The interval excludes 50%, so the lead is statistically significant at the 95% level.
Key Takeaways
Summary: Confidence Intervals
- Structure: Point estimate ± critical value × SE. Narrower CIs = more precise estimates.
- Z vs T: Use z when is known; use t when is unknown (almost always). The t-distribution has heavier tails for small .
- Wilson > Wald for proportions: Use Wilson score interval when is near 0 or 1 or is small.
- To halve ME, quadruple : Since , precision improvement is expensive.
- Bootstrap CIs: Resample with replacement, take percentiles. Works for any statistic without distributional assumptions.
- Decision Rule: CI excludes null value -> reject at the corresponding .
- Misinterpretation: A 95% CI does NOT mean "95% probability the parameter is in this interval." It means 95% of such intervals would capture the parameter in repeated sampling.
- Bayesian Alternative: Credible intervals DO have the interpretation "95% probability the parameter is in this interval."
Deep Dive
For detailed explanations, worked examples, and Python implementations, explore the dedicated statistics lessons:
Confidence Intervals for Means
- Confidence Intervals for the Mean — Z-interval and t-interval with full derivations, examples, and Python code
Confidence Intervals for Proportions
- Confidence Intervals for Proportions — Wilson score interval, Agresti-Coull, and when each is appropriate
Margin of Error
- Margin of Error — Factors affecting ME, the rate, and practical guidelines for study planning
Sample Size Determination
- Sample Size Determination — Formulas for means and proportions, power considerations, and conservative estimates
Bootstrap Methods
- Bootstrap Confidence Intervals — Percentile, BCa, and pivotal methods for distribution-free inference
Related Topics
- Central Limit Theorem — Foundation for why CIs work: the sampling distribution of the mean is approximately Normal
- Point Estimation — MLE and the point estimates that CIs are built around
- Hypothesis Testing — CIs and hypothesis tests are duals: same information, different format
- t-Distribution — The heavier-tailed distribution used when σ is unknown