Confidence intervals and sample size
- Read it, not yetReach the end of the page
- Practice it, not yetAnswer a few questions
- Master it, not yet80% on a drill of 8 or more
A confidence interval is your estimate plus or minus a margin: estimate ± critical value × standard error. Use z when σ is known, t when you only have s.
Why it matters
A confidence interval is your estimate with honest error bars.
A number without a margin is a guess dressed as fact. The interval says if a difference is real or noise.
- Polls48% plus or minus 3 means the race is open.
- ProductA 4.1% conversion rate over 5,000 visits is really 3.6% to 4.7%.
- SurveysSample size math says how many people to ask before you trust the answer.
Tennis example
You charted 20 matches: average first serve 115 mph, s = 6. 95% CI: 115 ± 2.093 × 6/√20 = 115 ± 2.8, so 112.2 to 117.8. For ±1 mph at 95%, n = (1.96 × 6 / 1)² ≈ 139 matches.
100 confidence intervals: how many catch μ = 50?
0 of 100 intervals caught μ = 50, with n = 25 at 95% (expect about 95). Misses are red. Bigger n makes the intervals shorter; higher confidence makes them longer.
Check yourself
General formula?
Point estimate ± (critical value)(standard error)25 bottles, = 502.4 ml, σ = 5 known: 95% CI?
500.44 to 504.36502.4 ± 1.96 × 5/√25.16 trainees, = 72.5, s = 12: 95% CI?
66.11 to 78.89t(0.025, 15) = 2.131, so ± 6.39.
The trap
The mistake people make most on this one.
A 95% CI is not a 95% chance that μ is inside. μ is fixed; the interval moves. For sample size, width is 2E: width 0.06 means E = 0.03.
Formulas
6 formulas and a way to remember them.
- σ known
- ± z(α/2) · σ / √n
- σ unknown
- ± t(α/2, n − 1) · s / √n
- Proportion
- p hat ± z(α/2) · √[p hat(1 − p hat) / n]
- Sample size for μ
- n = (zσ / E)²
- Sample size for p
- n = z² p(1 − p) / E², using p = 0.5 with no prior estimate
- z values
- 1.645 (90%), 1.96 (95%), 2.576 (99%). Always round n up.
- Remember it
- A confidence interval is a margin of error around your guess. More confidence widens it; more data tightens it.
Watch and go deeper
3 free videos and pages.
- jbstatistics: Introduction to Confidence IntervalsWhat a confidence interval is and the right way to say what 95% means. About 7 minutes.
- R Psychologist: Interpreting Confidence IntervalsWatch intervals from repeated samples and count how many miss the true mean. About 5 minutes.
- jbstatistics: Determining the Required Sample SizeSolve the margin of error formula for n, with a worked example. About 5 minutes.