Point estimate and interval estimate
We usually cannot measure a whole population, so we take a sample. The sample mean x̄ estimates the population mean μ. The sample proportion p̂ estimates the population proportion p.
A single number like x̄ = 150.4 cm is a point estimate. It is useful, but it does not say how far off it might be.
An interval estimate (confidence interval) gives a range plus a level of trust: "we are 95% confident μ is between 147.3 cm and 153.5 cm".
Every confidence interval has the same shape:
estimate ± (critical value) × (standard error)
The part after ± is called the margin of error (ME). The width of the interval is 2 × ME.
Confidence interval for a mean (z and t)
When σ is known (or n is large)
The standard error of x̄ is σ/√n. The interval is x̄ ± z* · σ/√n.
| Level | z* |
|---|---|
| 90% | 1.645 |
| 95% | 1.96 |
| 99% | 2.576 |
When σ is unknown: use t
Usually we do not know σ, so we use the sample standard deviation s. This adds extra uncertainty, so we use the t-distribution with n − 1 degrees of freedom: x̄ ± t* · s/√n.
t* is bigger than z* for small samples (for n = 10 at 95%, t* = 2.262 instead of 1.96). As n grows, t* gets closer to z*.
Conditions to check
- Random: the sample is chosen at random.
- Independent: the sample is less than about 10% of the population.
- Normal: the population is roughly normal, or n is large (about 30 or more), so x̄ is roughly normal (central limit theorem).
Confidence interval for a proportion
For a yes/no question, p̂ = (number of yes) ÷ n. Its standard error is √(p̂(1 − p̂)/n).
p̂ ± z* · √(p̂(1 − p̂)/n)
Condition: at least about 10 "yes" and 10 "no" in the sample (n·p̂ ≥ 10 and n(1 − p̂) ≥ 10), so the normal model works.
Choosing the sample size
To get a margin of error E: for a mean, n = (z*σ/E)²; for a proportion, n = p(1 − p)(z*/E)², using p = 0.5 if you have no guess (this gives the safest, largest n). Always round up.
What "95% confident" really means
The true μ is a fixed number. It is the interval that changes from sample to sample. "95% confident" means: if we repeated the sampling many times and built an interval each time, about 95% of those intervals would contain μ (see step 5 in 3D: about 19 of 20 bars cross the green line).
It does not mean "95% of the data lie in the interval", and it does not mean "μ moves around".
What makes an interval narrower?
- A bigger sample: ME has √n at the bottom, so 4 times the sample halves the ME.
- A lower confidence level: narrower, but you trust it less.
- Less spread in the data (smaller σ), which you usually cannot control.
Comparing two groups and judging claims
Difference of two means
(x̄₁ − x̄₂) ± t* · √(s₁²/n₁ + s₂²/n₂). For large samples t* ≈ z*. For paired data (the same people measured twice), find the difference for each person and build a one-sample interval for the mean difference.
Difference of two proportions
(p̂₁ − p̂₂) ± z* · √(p̂₁(1 − p̂₁)/n₁ + p̂₂(1 − p̂₂)/n₂).
Using an interval to judge a claim
- If the claimed value is inside the interval, it is plausible: we cannot reject it.
- If it is outside, the data give evidence against the claim.
- For a difference, check whether 0 is inside. If 0 is outside, the two groups really seem to differ.
This matches a two-sided hypothesis test: a 95% interval that misses the claimed value goes with rejecting it at the 5% level.
Try it
Ask 20 friends how many hours they slept last night. Find x̄ and s. Build a 95% t-interval with t* = 2.093 (df = 19). Then ask 20 more people and rebuild it with all 40 (t* ≈ 2.023). Is the new interval narrower? In the 3D, move the n slider and watch the bar shrink.
Key formulas and definitions
- Interval = estimate ± critical value × standard error
- Mean, σ known: x̄ ± z* · σ/√n
- Mean, σ unknown: x̄ ± t* · s/√n, with df = n − 1
- Proportion: p̂ ± z* · √(p̂(1 − p̂)/n)
- Two means: (x̄₁ − x̄₂) ± t* · √(s₁²/n₁ + s₂²/n₂)
- Two proportions: (p̂₁ − p̂₂) ± z* · √(p̂₁(1 − p̂₁)/n₁ + p̂₂(1 − p̂₂)/n₂)
- Sample size: n = (z*σ/E)² for a mean; n = p(1 − p)(z*/E)² for a proportion
Worked examples
1. A random sample of 25 children has mean height x̄ = 150.4 cm. The population σ is 8 cm. Find a 95% confidence interval for μ.
SE = 8/√25 = 1.6 cm. ME = 1.96 × 1.6 = 3.14 cm. Interval: 150.4 ± 3.14 = (147.26, 153.54) cm. We are 95% confident the mean height of all such children is between 147.3 cm and 153.5 cm.
2. Repeat Example 1 at 99% confidence.
ME = 2.576 × 1.6 = 4.12 cm. Interval: (146.28, 154.52) cm. It is wider than the 95% interval because we want more confidence.
3. In a survey, 220 of 400 students prefer online notes. Find a 95% interval for the true proportion. Can we say a majority prefer online notes?
p̂ = 220/400 = 0.55. SE = √(0.55 × 0.45/400) = √0.000619 ≈ 0.0249. ME = 1.96 × 0.0249 ≈ 0.049. Interval: (0.501, 0.599). The whole interval is above 0.5, so the data support a majority, but only just.
4. A machine should fill 50 g packets. A sample of 10 packets has x̄ = 48.2 g and s = 2.5 g. Build a 95% interval (t* = 2.262 for df = 9). Is the machine working correctly?
SE = 2.5/√10 ≈ 0.791 g. ME = 2.262 × 0.791 ≈ 1.79 g. Interval: (46.41, 49.99) g. The target 50 g is just outside, so there is evidence the machine is under-filling.
5. How many children must we measure to estimate mean height within ±2 cm at 95% confidence, if σ = 8 cm?
n = (1.96 × 8 / 2)² = (7.84)² = 61.47. Round up: n = 62 children.
6. City A: 50 people, mean daily commute 72 min, s = 10. City B: 60 people, mean 68 min, s = 12. Find a 95% interval for μA − μB (large samples, use 1.96). Is there a real difference?
Difference = 4 min. SE = √(10²/50 + 12²/60) = √(2 + 2.4) = √4.4 ≈ 2.10. ME = 1.96 × 2.10 ≈ 4.11. Interval: (−0.11, 8.11) min. 0 is inside, so we cannot say the commutes really differ.
7. Old app: 90 of 200 users clicked. New app: 120 of 200 clicked. Find a 95% interval for pNew − pOld.
p̂New = 0.60, p̂Old = 0.45, difference = 0.15. SE = √(0.6 × 0.4/200 + 0.45 × 0.55/200) = √(0.0012 + 0.00124) ≈ 0.0494. ME = 1.96 × 0.0494 ≈ 0.097. Interval: (0.053, 0.247). 0 is outside, so the new app really seems better, by about 5 to 25 percentage points.
Common mistakes
- Saying "there is a 95% chance μ is in this interval" as if μ moves. μ is fixed; the method works 95% of the time.
- Using z* when σ is unknown and the sample is small. Use t* with n − 1 degrees of freedom.
- Forgetting the √ in √n, or dividing by n instead of √n when finding the standard error.
- Rounding the sample size down. n = 61.47 means 62, never 61.