Confidence Intervals Estimating Population Parameters
Learn what a confidence interval truly means, how to construct z-intervals and t-intervals, calculate the margin of error, and avoid the most common misinterpretations. 10 fully worked examples, interactive diagram, and a 10-question quiz.
StatisticsEstimationz-intervalt-intervalMargin of Error
Whenever you estimate a population parameter from a sample, you get a single number, a point estimate. The problem is that this estimate will almost certainly not equal the true population value. A different sample would give a slightly different estimate. How wrong could you be?
A confidence interval (CI) answers this by giving you a range of plausible values for the population parameter, together with a stated level of confidence. Instead of saying "the population mean is 72," you say "I am 95% confident the population mean lies between 68.4 and 75.6."
The interval is built around the point estimate, and its width is determined by three things: the confidence level (how certain you want to be), the standard error of the estimate (which depends on sample size and variability), and the appropriate critical value from a z or t distribution.
Prerequisites. You should be comfortable with the normal distribution, z-scores, and the Central Limit Theorem before this page. The Sampling & Estimation page covers all the background needed.
§ 02
The CI Formula — z-interval
When the population standard deviation σ is known, the confidence interval for the population mean μ is:
Confidence Interval for μ (σ known)
CI = x̄ ± z* · (σ / √n)
x̄ = sample mean
z* = critical value (from standard normal table)
σ = population standard deviation
n = sample size
σ/√n = standard error (SE)
The term z* · (σ/√n) is called the margin of error (ME). It is how far the interval extends on each side of x̄.
The critical value z* depends on the confidence level. The three most common values are:
Confidence Level
α (significance)
α/2
z* (critical value)
90%
0.10
0.05
1.645
95%
0.05
0.025
1.960
99%
0.01
0.005
2.576
§ 03
What 95% Confidence Actually Means
This is the most misunderstood concept in introductory statistics. A 95% CI does not mean there is a 95% probability that μ lies in your computed interval. The true μ is a fixed (unknown) constant, once you compute the interval from your data, μ either is or is not inside it. The probability is not 95%; it is either 0 or 1.
What 95% refers to is the procedure, not any single interval. If you were to take 100 different random samples and construct a 95% CI from each one, approximately 95 of those intervals would contain the true μ. Your specific interval is one realisation of that procedure.
What 95% CI does NOT mean. "There is a 95% chance μ is in this interval." The parameter μ is not random — only the interval is random (because it depends on the random sample). The correct phrasing is: "We used a procedure that captures μ 95% of the time."
§ 04
Interactive Diagram — Repeated Sampling
Confidence Interval Simulation
Click "Draw new samples" to see 20 confidence intervals built from repeated random samples. Intervals that miss the true mean (red dashed line) are highlighted in red.
§ 05
When σ Is Unknown — the t-interval
In practice, σ is almost never known. You replace it with the sample standard deviation s, but this introduces extra uncertainty, especially for small samples. To account for this, you use the t-distribution with n − 1 degrees of freedom rather than the standard normal.
Confidence Interval for μ (σ unknown — t-interval)
CI = x̄ ± t* · (s / √n)
t* = t-critical value with df = n − 1
s = sample standard deviation
The t-distribution has heavier tails than the normal, making the interval wider to reflect the additional uncertainty from estimating σ. As n increases, the t-distribution converges to the standard normal, for n ≥ 30, the difference is usually negligible in practice.
Rule of thumb. If σ is known, use z*. If σ is unknown and n ≥ 30, you can use z* with s in place of σ (the approximation is excellent). If σ is unknown and n < 30, always use t* with df = n − 1.
§ 06
Margin of Error and Sample Size
The margin of error ME = z* · (σ/√n) controls the width of the interval. To make the interval narrower (more precise) you can:
1. Increase the sample size n. Since ME ∝ 1/√n, quadrupling n halves the margin of error. This is the most practical lever.
2. Reduce the confidence level. A 90% CI is narrower than a 95% CI, but you sacrifice certainty.
3. Reduce σ. This means collecting more homogeneous data or improving measurement precision.
Required Sample Size for Desired Margin of Error E
n = (z* · σ / E)²
Round UP to the nearest integer — rounding down gives an interval wider than E.
§ 07
10 Fully Worked Examples
Example 1 — Basic 95% z-intervalEasy
A sample of n = 64 has x̄ = 50, and the population σ = 8. Construct a 95% CI for μ.
1
SE = σ/√n = 8/√64 = 8/8 = 1.
2
z* = 1.960 for 95% confidence.
3
ME = 1.960 × 1 = 1.960.
4
CI = 50 ± 1.960 = (48.04, 51.96).
95% CI: (48.04, 51.96)
Example 2 — 99% z-intervalEasy
x̄ = 120, σ = 15, n = 36. Build a 99% CI for μ.
1
SE = 15/√36 = 15/6 = 2.5.
2
z* = 2.576 for 99% confidence.
3
ME = 2.576 × 2.5 = 6.44.
4
CI = 120 ± 6.44 = (113.56, 126.44).
99% CI: (113.56, 126.44)
Example 3 — t-interval, small sampleMedium
A sample of n = 16 yields x̄ = 42 and s = 5. Construct a 95% CI for μ (σ unknown).
1
df = n − 1 = 15. From t-table, t* = 2.131 at 95%, df = 15.
2
SE = s/√n = 5/4 = 1.25.
3
ME = 2.131 × 1.25 = 2.664.
4
CI = 42 ± 2.664 = (39.34, 44.66).
95% t-interval: (39.34, 44.66)
Example 4 — Find the required sample sizeMedium
You want a 95% CI for μ with ME ≤ 3. The population σ = 12. What sample size is needed?
Required n = 2401 — the classic "±2% poll" sample size
§ 08
Common Mistakes
Mistake 1 — Wrong interpretation. "There is a 95% probability that μ is in this interval." No — μ is fixed. The 95% refers to the long-run coverage of the procedure, not any single interval.
Mistake 2 — Using z when you should use t. If σ is unknown and n < 30, always use the t-distribution with df = n − 1. Using z underestimates the width of the interval.
Mistake 3 — Rounding sample size down. When solving for n, always round UP. Rounding down gives a margin of error slightly larger than desired.
Mistake 4 — Confusing width and margin of error. The width of a CI is 2 × ME (it covers both sides). The margin of error is just one side: z* · SE.
Mistake 5 — Forgetting conditions. The z-interval assumes: (i) random sample, (ii) n large enough for CLT (≥ 30) or population is normal, (iii) σ known. Check these before computing.