Confidence Intervals & Hypothesis Testing

Skill: inference

Confidence Intervals & Hypothesis Testing

Build and interpret confidence intervals, set up hypotheses, compute test statistics and p-values, and conclude without overclaiming.

1 Confidence intervals: estimate with a margin

A confidence interval is a range of plausible values for a parameter, built as estimate ± margin of error. The confidence level (90%, 95%, 99%) picks the critical value z*.

CI for a mean (σ known)
x̄ ± z* · σ/√n   |   z*: 90% → 1.645, 95% → 1.96, 99% → 2.576
CI for a proportion: p̂ ± z* · √(p̂(1−p̂)/n)

Bigger n → smaller margin. Higher confidence → wider interval (same n).

Example 95% CI for a mean
  1. x̄ = 50, σ = 12, n = 36, z* = 1.96.
  2. Margin = 1.96 × 12/√36 = 1.96 × 2 = 3.92.
  3. CI: 50 ± 3.92 = (46.08, 53.92).
Example 95% CI for a proportion
  1. 40 of 100 voters favor a measure: p̂ = 0.40, z* = 1.96.
  2. SE = √(0.4×0.6/100) = 0.049; margin = 1.96 × 0.049 ≈ 0.096.
  3. CI: 0.40 ± 0.096 = (0.304, 0.496).

2 What “95% confident” really means

The 95% describes the method, not this one interval. If you repeated the sampling endlessly, about 95% of the intervals built this way would capture the true parameter.

Correct interpretation
“We are 95% confident the true mean lies between 46.1 and 53.9.”

Wrong: “There is a 95% chance μ is in (46.1, 53.9).” μ is fixed — the interval either caught it or missed. Also wrong: “95% of the data is in the interval.” The interval is about the parameter, not the data.

true μ 11 of 12 capture μ — about 95% in the long run

3 Hypotheses: H0 vs Ha

A hypothesis test weighs evidence against a default claim. H0 (null) is the status quo with equality; Ha (alternative) is what you suspect, with <, >, or ≠.

Setup pattern
H0: μ = value   |   Ha: μ < value, μ > value, or μ ≠ value

The direction in Ha (<, >, ≠) decides whether the p-value uses one tail or two.

Example Battery claim
  1. Claim: batteries last 100 hours. Suspicion: they last less.
  2. H0: μ = 100; Ha: μ < 100 (one-sided).

4 Test statistic and p-value

The z-statistic measures how many SEs the sample is from H0. The p-value is the probability of data this extreme if H0 were true — small p argues against H0.

z-test for a mean
z = (x̄ − μ0) / (σ/√n)

Reject H0 when p < α (often 0.05). Then: “convincing evidence for Ha” — never “proof”. The threshold α is called the significance level.

Example z and conclusion
  1. x̄ = 105, μ0 = 100, σ = 15, n = 25: z = (105−100)/(15/5) = 1.67.
  2. Two-sided p ≈ 0.096 > 0.05: fail to reject H0 — not convincing evidence the mean differs.

5 Common mistakes

“95% chance μ is in the interval.” Wrong — 95% describes the method’s long-run capture rate. Say “we are 95% confident the true mean is between a and b.”
p < 0.05 as proof. A small p-value rejects H0; it does not prove Ha, and it says nothing about practical importance. Always conclude in context.
Accepting H0. “Fail to reject” is not “accept” — the data were simply not convincing enough against the null.

6 Key vocabulary

Confidence interval
Estimate ± margin; a range of plausible parameter values.
Margin of error
z* × SE; shrinks with √n.
Critical value z*
1.645 (90%), 1.96 (95%), 2.576 (99%).
Null / alternative
H0: status quo (=); Ha: suspicion (<, >, ≠).
p-value
P(data this extreme | H0 true). Small p → reject H0.
Significance level α
Threshold (often 0.05) for rejecting H0.

7 Quick checks

1. Quadrupling n does what to the margin of error?
Halves it. Margin has 1/√n; √4 = 2.
2. p = 0.03, α = 0.05. Decision and wording?
Reject H0: convincing evidence for Ha (not proof).
3. Fix the sentence: “There is a 95% chance μ is in (2, 8).”
“We are 95% confident the true mean is between 2 and 8.” Confidence describes the method.
Fibo · Learn, Practice & Explore Math