Confidence Intervals
Statistical Inference & Applied Statistics
Chapter 3 · Confidence Intervals
Chapter 2 established that a point estimate always carries sampling error. A confidence interval is the direct, practical fix: instead of reporting a single number as if it were exact, report a range of plausible values, together with how confident that range actually is.
Building a Confidence Interval
CI = point estimate ± (critical value × standard error)
The critical value (z*) comes straight from Probability & Statistics Fundamentals' own standard normal distribution — how many standard errors wide the interval needs to be to capture the stated percentage of the sampling distribution:
| Confidence level | Critical value (z*) |
|---|---|
| 90% | 1.645 |
| 95% | 1.960 |
| 99% | 2.576 |
Worked Example: The Response-Time Sample, Revisited
Reusing Chapter 2's own sample: n = 25 requests, sample mean x̄ = 204ms, σ = 30ms (still assumed known here — Chapter 5's own t-test covers the more realistic case where σ itself must be estimated). Standard error: SE = 30/√25 = 6ms.
| Confidence level | Interval | Width |
|---|---|---|
| 90% | [194.13, 213.87] | 19.74ms |
| 95% | [192.24, 215.76] | 23.52ms |
| 99% | [188.54, 219.46] | 30.91ms |
Width Shrinks With Sample Size
Reusing Chapter 2's own three sample sizes, at a fixed 95% confidence level:
| n | SE | 95% CI width |
|---|---|---|
| 25 | 6.0ms | 23.52ms |
| 100 | 3.0ms | 11.76ms |
| 900 | 1.0ms | 3.92ms |
More data doesn't change the confidence level — it tightens the interval at whatever confidence level was chosen, exactly Chapter 2's own σ/√n shrinkage, now made directly visible in the width of the reported range.
What a Confidence Interval Actually Means
A Forward Note: Proportions
Everything above used a sample mean. Chapter 6's A/B testing material needs confidence intervals for a proportion instead — a conversion rate, not an average response time. The idea is identical; only the standard error formula changes, to SE = √(p(1−p)/n). The confidence interval itself still follows the exact same estimate ± z* × SE shape.
Confidence Intervals in Code
Hands-On Exercises
A sample of n = 16 gives a sample mean of 550, with a known σ = 48. Compute the standard error, then the 95% confidence interval.
Given a fixed standard error of SE = 10, compute the width of the confidence interval at the 90%, 95%, and 99% confidence levels, using this chapter's own critical values. Confirm the widths increase as confidence increases, matching this chapter's own confidence-vs-width tradeoff.
A teammate says "we're 95% confident the true average is between 190ms and 210ms, so there's a 95% chance the real value is in that range." Using this chapter's own correct interpretation, explain specifically what's wrong with the teammate's restatement, and give the statistically correct version of the claim.
📄 View solutionChapter 3 Quick Reference
- CI formula:
point estimate ± (z* × SE), reusing Chapter 2's own standard error directly - Critical values: 90% → 1.645, 95% → 1.96, 99% → 2.576
- Higher confidence requires a wider interval — the confidence-vs-width tradeoff, with no way around it
- Interval width shrinks with sample size at any fixed confidence level, following Chapter 2's own
σ/√nshrinkage exactly - A 95% CI means: if this method were repeated many times, ~95% of the resulting intervals would contain the true value — not "95% probability this specific interval contains it"
- The same
estimate ± z* × SEshape applies to proportions too, withSE = √(p(1−p)/n)— Chapter 6's own A/B testing material - Next chapter: Hypothesis testing fundamentals