← Statistics

Statistics

Confidence Intervals and Hypothesis Tests

Lesson

A confidence interval turns a single estimate into a range — the band of plausible values. A hypothesis test compares the data to a specific claim and asks: how surprising would the data be if the claim were true?

Confidence interval (for a mean)

xˉ±zσn\bar{x} \pm z^* \cdot \frac{\sigma}{\sqrt{n}}

xˉ\bar{x} is the sample mean. σ/n\sigma/\sqrt{n} is the standard error. zz^* is the critical value for the desired confidence:

  • 90% confidence: z1.645z^* \approx 1.645
  • 95% confidence: z1.962z^* \approx 1.96 \approx 2
  • 99% confidence: z2.5762.5z^* \approx 2.576 \approx 2.5

Margin of error (MoE)

MoE=zSE\text{MoE} = z^* \cdot \text{SE}

Half the CI’s width. The full interval is xˉMoE\bar{x} - \text{MoE} to xˉ+MoE\bar{x} + \text{MoE}.

Worked example — 95% CI for a mean

xˉ=100, σ=10, n=25\bar{x} = 100, \ \sigma = 10, \ n = 25. Using z=2z^* = 2:

SE=10/25=2\text{SE} = 10 / \sqrt{25} = 2
MoE=22=4\text{MoE} = 2 \cdot 2 = 4
CI: (1004, 100+4)=(96,104)\text{CI: } (100 - 4, \ 100 + 4) = (96, 104)

Hypothesis test (one-sample z)

z=xˉμ0σ/nz = \frac{\bar{x} - \mu_0}{\sigma/\sqrt{n}}

μ0\mu_0 is the claimed value under the null hypothesis H0H_0. Big |z| → strong evidence against H0H_0.

Rough rule: reject H0H_0 at the 5% level if z>2|z| > 2 (more precisely 1.96).

Reading a CI

  • The midpoint of a CI is the sample estimate.
  • Half the width is the margin of error.
  • If a claimed value is OUTSIDE the CI, the data argue against it.

Practice

Work through these. Stuck? Click Get a hint.

Warm-Up

Quick problems to get going.

Problem 1

z for 95% confidence (round to integer)z^* \text{ for 95\% confidence (round to integer)}

Problem 2

xˉ=50, MoE=5.Lower bound of 95% CI?\begin{gathered}\bar{x} = 50, \ \text{MoE} = 5. \\ \text{Lower bound of 95\% CI?}\end{gathered}

Problem 3

xˉ=50, MoE=5.Upper bound?\begin{gathered}\bar{x} = 50, \ \text{MoE} = 5. \\ \text{Upper bound?}\end{gathered}

Problem 4

95% CI is (10,20). Point estimate?\text{95\% CI is } (10, 20). \text{ Point estimate?}

Practice

Standard problems matching the lesson.

Problem 5

xˉ=80, MoE=3. Lower?\bar{x} = 80, \ \text{MoE} = 3. \text{ Lower?}

Problem 6

xˉ=80, MoE=3. Upper?\bar{x} = 80, \ \text{MoE} = 3. \text{ Upper?}

Problem 7

95% CI is (50,70). Point estimate?\text{95\% CI is } (50, 70). \text{ Point estimate?}

Problem 8

95% CI is (50,70). MoE?\text{95\% CI is } (50, 70). \text{ MoE?}

Problem 9

xˉ=100, σ=10, n=25, z=2.MoE?\begin{gathered}\bar{x} = 100, \ \sigma = 10, \ n = 25, \ z^* = 2. \\ \text{MoE?}\end{gathered}

Problem 10

xˉ=100, σ=10, n=25, z=2.Lower of 95% CI?\begin{gathered}\bar{x} = 100, \ \sigma = 10, \ n = 25, \ z^* = 2. \\ \text{Lower of 95\% CI?}\end{gathered}

Problem 11

xˉ=100, σ=10, n=25, z=2.Upper of 95% CI?\begin{gathered}\bar{x} = 100, \ \sigma = 10, \ n = 25, \ z^* = 2. \\ \text{Upper of 95\% CI?}\end{gathered}

Problem 12

xˉ=200, σ=20, n=100, z=2.MoE?\begin{gathered}\bar{x} = 200, \ \sigma = 20, \ n = 100, \ z^* = 2. \\ \text{MoE?}\end{gathered}

Problem 13

Same. Lower of 95% CI?\text{Same. Lower of 95\% CI?}

Problem 14

Same. Upper of 95% CI?\text{Same. Upper of 95\% CI?}

Problem 15

z=60502. Compute z.z = \frac{60 - 50}{2}. \text{ Compute } z.

Problem 16

z=45505. Compute z.z = \frac{45 - 50}{5}. \text{ Compute } z.

Problem 17

IQ n=36, x̄=105, σ=15, z*=2. MoE?

Problem 18

Same IQ sample. Lower of 95% CI?\text{Same IQ sample. Lower of 95\% CI?}

Challenge

Harder problems — edge cases, trickier numbers, multiple steps.

Problem 19

z=2.5 (99% approx).SE=4. MoE?\begin{gathered}z^* = 2.5 \text{ (99\% approx).} \\ \text{SE} = 4. \text{ MoE?}\end{gathered}

Problem 20

H0:μ=50. xˉ=55, SE=2.Test statistic z?\begin{gathered}H_0: \mu = 50. \ \bar{x} = 55, \ \text{SE} = 2. \\ \text{Test statistic } z?\end{gathered}

Problem 21

95% CI (40,60). Width?\text{95\% CI } (40, 60). \text{ Width?}

Problem 22

Same CI. MoE?\text{Same CI. MoE?}

Problem 23

z=2.5, reject?

Problem 24

z=1.5, reject?

Problem 25

95% CI for proportion: (0.45,0.55). Point estimate?\text{95\% CI for proportion: } (0.45, 0.55). \text{ Point estimate?}

Ask the tutor

Stuck on a concept? Want another example? Ask anything about this topic.

Type your own question below, or tap one of the suggestions. The tutor can re-explain the lesson, work through a specific problem with you, generate fresh practice tuned to where you are, or check your reasoning.

Quiz

Test yourself on this topic →

10 questions, no hints. About 5 minutes.