Tests for a mean (σ unknown) and for a proportion
Same five steps. New tests.
When σ is unknown, or the parameter is a proportion, only the inside of steps 2 to 4 changes.
- ?
- ? which test?
- ? which statistic?
- ? which table?
- ?
Anonymous check
Which order do the five steps follow?
Every hypothesis test in this course follows the same five steps, in the same order. The names are hidden on the rail below.
- ?
- ?
- ?
- ?
- ?
-
Hypotheses → Conditions → Statistic → p-value → Conclude
-
Statistic → p-value → Hypotheses → Conditions → Conclude
-
Conditions → Statistic → Hypotheses → p-value → Conclude
-
Hypotheses → Statistic → p-value → Conditions → Conclude
Anonymous check
Which p-value may be printed?
A hypothetical watchdog claims 15% of households were overcharged. A random survey finds 18 of 80 (22.5%). No direction was written down before the survey. Three analysts report three p-values from the same data.
- Analyst 1one tail · SE from \(p_0\)p ≈ 0.030
- Analyst 2two tails · SE from \(p_0\)p ≈ 0.060
- Analyst 3two tails · SE from \(\hat{p}\)p ≈ 0.108
-
Analyst 1: p ≈ 0.030
-
Analyst 2: p ≈ 0.060
-
Analyst 3: p ≈ 0.108
-
Any of them: the data are the same
Anonymous check
How often does this z rule raise a false alarm?
Samples of 4 values come from a population whose mean really is the claimed value. Only each sample's own standard deviation is available. One analyst tests at the 5% significance level but keeps the z cutoff 1.96 instead of using the t-table.
-
About 5%
-
About 10%
-
About 15%
-
About 25%
C1 · Figure 1 from the lesson, as long-run rates
With s instead of σ, the z cutoff lies.
H₀ true every time, tests at the 5% level. Share of tests that wrongly reject, in the long run.
| n | z cutoff 1.96 | t-table cutoff |
|---|---|---|
| 4 | 14.5% | 5.0% |
| 6 | 10.7% | 5.0% |
| 9 | 8.6% | 5.0% |
| 12 | 7.6% | 5.0% |
| 16 | 6.9% | 5.0% |
| 30 | 6.0% | 5.0% |
The t-table cutoff keeps the promise: about 5% at every n.
Step 2 now chooses the test: σ unknown → t, at any n.
- Hypotheses
- Conditions choose the test
- Statistic
- p-value
- Conclude
C1 · Figure 2 from the lesson
Step 2 starts by choosing the test.
- ① Estimate or test a claim? new is there a claimed value to test?
- estimate → Interval (L-INF-2 to L-INF-4), no H₀, SE from the data
- test a claim → go to ②
- ② Mean or proportion? measured amount vs. yes/no count
- mean μ → go to ③ for a mean
- proportion p → go to ③ for a proportion
- For a mean ③ Is σ known? not “is n small?”
- σ known → z-test for μ, SE = σ/√n
- s only → t-test for μ, SE = s/√n, df = n − 1
- either test → then ④
- For a proportion ③ np₀ ≥ 10 and n(1 − p₀) ≥ 10? counts from the claim p₀, not p̂
- yes → z-test for p, SE = √(p₀(1 − p₀)/n)
- no → Stop: too few expected counts
- Both mean tests ④ Shape OK for this n? new look for strong skew or outliers when n is small
- OK → run the test
- not OK → Stop: collect more data or use another method
- Estimate or test a claim? With no claimed value, estimate with an interval.
- A mean or a proportion?
- For a mean: is σ known? Known: z-test for μ. Only s: t-test for μ. For a proportion: are n p₀ and n(1 − p₀) both at least 10? Yes: z-test for p. No: stop.
- For either mean test: is the shape acceptable for this n? No: stop.
Anonymous check
Which procedure fits?
A maker claims its batteries last 500 hours on average. A random sample of 41 batteries reports its sample mean and sample standard deviation.
-
t-test with df = 40
-
z-test, because n is at least 30
-
z-test, because the data look normal
-
No test is possible, because σ is unknown
- Hypotheses
- Conditions σ unknown → t
- Statistic s and df = n − 1
- p-value t-table: a bound
- Conclude
C2 · the t statistic
Only σ changes to s, and t brings its df.
- L-INF-5\(z = \dfrac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}\)
- Today\(t = \dfrac{\bar{x} - \mu_0}{s / \sqrt{n}}\) with \(df = n - 1\)
- \(\mu_0 = 500,\ \bar{x} = 512,\ s = 18,\ n = 9\): \(\text{SE} = 18/\sqrt{9} = 6\)
- \(t = (512 - 500)/6 = 2.00,\quad df = 8\)
- Hypotheses
- Conditions σ unknown → t
- Statistic s and df = n − 1
- p-value t-table: a bound
- Conclude
C3 · reading the t-table
Step 4: |t| = 2.45 with df = 11, two-sided.
The t-table gives critical values, not areas. |t| falls between two of them: the p-value falls between their tail areas.
| one tail | 0.10 | 0.05 | 0.025 | 0.01 | 0.005 | 0.0005 |
|---|---|---|---|---|---|---|
| two tails | 0.20 | 0.10 | 0.05 | 0.02 | 0.01 | 0.001 |
| df 10 | 1.372 | 1.812 | 2.228 | 2.764 | 3.169 | 4.587 |
| df 11 | 1.363 | 1.796 | 2.201 | 2.718 | 3.106 | 4.437 |
| df 12 | 1.356 | 1.782 | 2.179 | 2.681 | 3.055 | 4.318 |
- Row df = 11
- Hₐ is two-sided: read the two-tail areas
- 2.201 < 2.45 < 2.718 → 0.02 < p < 0.05
- 0.02 < p < 0.05
- Software: \(p \approx 0.032\). The bound already decides at \(\alpha = 0.05\).
Anonymous check
What can we say about the p-value?
A random sample of 13 values tests whether a mean differs from a claim, in either direction: t = 2.30 with df = 12. The t-table rows are shown.
| one tail | 0.10 | 0.05 | 0.025 | 0.01 | 0.005 | 0.0005 |
|---|---|---|---|---|---|---|
| two tails | 0.20 | 0.10 | 0.05 | 0.02 | 0.01 | 0.001 |
| df 11 | 1.363 | 1.796 | 2.201 | 2.718 | 3.106 | 4.437 |
| df 12 | 1.356 | 1.782 | 2.179 | 2.681 | 3.055 | 4.318 |
| df 13 | 1.350 | 1.771 | 2.160 | 2.650 | 3.012 | 4.221 |
-
0.02 < p < 0.05
-
0.01 < p < 0.025
-
p ≈ 0.0214, from the z-table
-
Nothing without software
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Expert model · t-test (hypothetical)
Are the bottles filled to 330 mL?
Random sample of \(n = 16\) bottles, under 10% of the day's output: \(\bar{x} = 331.8\) mL, \(s = 2.4\) mL. Fill volumes are approximately normal. No direction was claimed.
- \(H_0: \mu = 330,\quad H_a: \mu \ne 330,\quad \alpha = 0.05\)
- Random, under 10%, approximately normal. Only \(s\) is known: t-test.
- \(\text{SE} = 2.4/\sqrt{16} = 0.6\)
- \(t = (331.8 - 330)/0.6 = 3.00,\quad df = 15\)
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Expert model · t-test (hypothetical)
Step 4: t = 3.00, df = 15, two-sided.
\(H_a: \mu \ne 330\) mL, \(\alpha = 0.05\).
| one tail | 0.10 | 0.05 | 0.025 | 0.01 | 0.005 | 0.0005 |
|---|---|---|---|---|---|---|
| two tails | 0.20 | 0.10 | 0.05 | 0.02 | 0.01 | 0.001 |
| df 14 | 1.345 | 1.761 | 2.145 | 2.624 | 2.977 | 4.140 |
| df 15 | 1.341 | 1.753 | 2.131 | 2.602 | 2.947 | 4.073 |
| df 16 | 1.337 | 1.746 | 2.120 | 2.583 | 2.921 | 4.015 |
- Row df = 15
- Hₐ is two-sided: read the two-tail areas
- 2.947 < 3.00 < 4.073 → 0.001 < p < 0.01
- 0.001 < p < 0.01 (software ≈ 0.009)
- \(p < 0.05\): reject \(H_0\).
- At the 5% level, evidence that the mean fill differs from 330 mL.
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Guided · t-test (hypothetical) · you write steps 2 and 3
Does the warm-up cut the 40 m sprint below 6.0 s?
The coach claimed “faster” before testing. Random sample of \(n = 9\) athletes: \(\bar{x} = 5.82\) s, \(s = 0.30\) s. Times are approximately normal.
- \(H_0: \mu = 6.0,\quad H_a: \mu < 6.0,\quad \alpha = 0.05\)
- Your turn: steps 2 and 3, on paper.
- Random, approximately normal, only \(s\): t-test.
- \(\text{SE} = 0.30/\sqrt{9} = 0.10,\quad t = (5.82 - 6.0)/0.10 = -1.80,\quad df = 8\)
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Guided · t-test (hypothetical)
Step 4: t = −1.80, df = 8, left-tailed.
\(H_a: \mu < 6.0\) s, \(\alpha = 0.05\). The table lists positive values: use \(|t| = 1.80\).
| one tail | 0.10 | 0.05 | 0.025 | 0.01 | 0.005 | 0.0005 |
|---|---|---|---|---|---|---|
| two tails | 0.20 | 0.10 | 0.05 | 0.02 | 0.01 | 0.001 |
| df 7 | 1.415 | 1.895 | 2.365 | 2.998 | 3.499 | 5.408 |
| df 8 | 1.397 | 1.860 | 2.306 | 2.896 | 3.355 | 5.041 |
| df 9 | 1.383 | 1.833 | 2.262 | 2.821 | 3.250 | 4.781 |
- Row df = 8
- Hₐ is one-sided: read the one-tail areas
- 1.397 < 1.80 < 1.860 → 0.05 < p < 0.10
- 0.05 < p < 0.10 (software ≈ 0.055)
- \(p > 0.05\): fail to reject \(H_0\). Not enough evidence the warm-up helps.
- The z-table would give \(1 - 0.9641 = 0.0359\): a false “reject”.
- Hypotheses
- Conditions counts with p₀ ≥ 10
- Statistic SE from p₀
- p-value z-table
- Conclude
C4 · conditions for a proportion test
Check the counts with the claim, p₀.
- Random sample, independent, under 10% of the population.
- \(np_0 \ge 10\) and \(n(1 - p_0) \ge 10\), computed with \(p_0\), not \(\hat p\).
- 40 households, claim 15%: \(np_0 = 40(0.15) = 6 < 10\).
- Stop. The test does not run. Not “fail to reject”: no test happened.
Anonymous check
May the one-proportion z-test run?
A supplier claims a 4% defect rate. A random sample of 200 parts finds 14 defective.
-
No: np₀ = 8 is below 10, so stop
-
Yes: 14 and 186 are both at least 10
-
Yes: n = 200 is at least 30
-
Yes: np₀ = 8 is at least 5
- Hypotheses
- Conditions counts with p₀ ≥ 10
- Statistic SE from p₀
- p-value z-table
- Conclude
C5 · the proportion test statistic · the survey
The standard error comes from p₀ too.
Claim \(p_0 = 0.15\); survey 18 of 80, \(\hat p = 0.225\). Counts: \(np_0 = 12\), \(n(1-p_0) = 68\).
- \(z = \dfrac{\hat{p} - p_0}{\sqrt{p_0(1 - p_0)/n}}\)
- \(\text{SE}_0 = \sqrt{0.15 \times 0.85 / 80} \approx 0.0399,\quad z \approx 1.88\)
- Analyst 3 used \(\hat p\): \(\sqrt{0.225 \times 0.775 / 80} \approx 0.0467\), \(z \approx 1.61\). Analyst 3 is out.
Anonymous check
Which standard error does the test use?
Claim: 20% of students ride the night bus. A random sample finds 39 of 150 (a sample proportion of 0.26).
-
√(0.20 × 0.80 / 150) ≈ 0.0327
-
√(0.26 × 0.74 / 150) ≈ 0.0358
-
√(0.20 × 0.80) / 150 ≈ 0.0027
-
0.20 × 0.80 / 150 ≈ 0.0011
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
C6 · Figure 5 from the lesson · the survey
The tail is chosen before the data.
Watchdog survey: 18 of 80 households, p̂ = 0.225. Claim H₀: p = 0.15 (np₀ = 12 and n(1 − p₀) = 68, both at least 10).
- Analyst 1 one tail · SE from p₀ p ≈ 0.030 → reject Current setting
- Analyst 2 two tails · SE from p₀ p ≈ 0.060 → fail to reject
- Analyst 3 two tails · SE from p̂ p ≈ 0.108 · ✗ wrong SE
- Statistic
- z ≈ 1.88, with SE from p₀ = 0.15: √(0.15 × 0.85 / 80) ≈ 0.0399
- p-value
- p ≈ 0.030 (one tail)
- Decision
- Analyst 1: reject H₀ at α = 0.05
- Why
- Legitimate only because Hₐ: p > 0.15 was written before the survey. The watchdog wrote it after seeing p̂ = 0.225: flip the first switch.
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Expert model · proportion test (hypothetical)
Analyst 2's test, done right.
Claim: 15% of households overcharged. Random survey: 18 of 80. No direction written before the survey.
- \(H_0: p = 0.15,\quad H_a: p \ne 0.15,\quad \alpha = 0.05\)
- Random; \(np_0 = 12 \ge 10\), \(n(1 - p_0) = 68 \ge 10\): z-test for p.
- \(\hat p = 18/80 = 0.225,\quad \text{SE}_0 = \sqrt{0.15 \times 0.85/80} \approx 0.0399\)
- \(z = (0.225 - 0.15)/0.0399 \approx 1.88\)
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Expert model · proportion test (hypothetical)
Step 4: z ≈ 1.88, two-sided.
\(H_a: p \ne 0.15\), \(\alpha = 0.05\). Back to the z-table.
| z | .05 | .06 | .07 | .08 | .09 |
|---|---|---|---|---|---|
| 1.6 | 0.9505 | 0.9515 | 0.9525 | 0.9535 | 0.9545 |
| 1.7 | 0.9599 | 0.9608 | 0.9616 | 0.9625 | 0.9633 |
| 1.8 | 0.9678 | 0.9686 | 0.9693 | 0.9699 | 0.9706 |
| 1.9 | 0.9744 | 0.9750 | 0.9756 | 0.9761 | 0.9767 |
| 2.0 | 0.9798 | 0.9803 | 0.9808 | 0.9812 | 0.9817 |
- Row 1.8: z to one decimal
- Column .08: second decimal
- P(Z < 1.88) = 0.9699
- \(p = 2(1 - 0.9699) = 0.0602\)
- \(p > 0.05\): fail to reject \(H_0\).
- 22.5% is 7.5 points above 15%, but this survey is not strong evidence that the rate differs from 15%.
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Guided · proportion test (hypothetical) · you write steps 1 to 3
Do more than 8% of phones need repair?
Before the study, a consumer group stated it would test “more than 8%”. Random sample: 29 of 250 phones needed repair. \(\alpha = 0.05\).
- Your turn: steps 1, 2 and 3, on paper.
- \(H_0: p = 0.08,\quad H_a: p > 0.08,\quad \alpha = 0.05\)
- Random; \(np_0 = 20 \ge 10\), \(n(1 - p_0) = 230 \ge 10\): z-test for p.
- \(\hat p = 0.116,\quad \text{SE}_0 = \sqrt{0.08 \times 0.92/250} \approx 0.01716,\quad z \approx 2.10\)
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Guided · proportion test (hypothetical) · name the cell first
Step 4: z ≈ 2.10, right-tailed.
\(H_a: p > 0.08\), \(\alpha = 0.05\). Say the row and column before they light up.
| z | .00 | .01 | .02 | .03 | .04 |
|---|---|---|---|---|---|
| 1.9 | 0.9713 | 0.9719 | 0.9726 | 0.9732 | 0.9738 |
| 2.0 | 0.9772 | 0.9778 | 0.9783 | 0.9788 | 0.9793 |
| 2.1 | 0.9821 | 0.9826 | 0.9830 | 0.9834 | 0.9838 |
| 2.2 | 0.9861 | 0.9864 | 0.9868 | 0.9871 | 0.9875 |
| 2.3 | 0.9893 | 0.9896 | 0.9898 | 0.9901 | 0.9904 |
- Row 2.1: z to one decimal
- Column .00: second decimal
- P(Z < 2.10) = 0.9821
- \(p = 1 - 0.9821 = 0.0179\)
- \(p < 0.05\): reject \(H_0\).
- Evidence that more than 8% of phones need repair (sample: 11.6%).
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude report the size too
C7 · Figure 6 from the lesson, at its preset sizes
The same 0.1 mL gap, four sample sizes.
Claim \(\mu_0 = 500\) mL, sample mean \(500.1\) mL, \(\sigma = 2\) mL. A gap that matters to customers: 5 mL.
| n | z | p (two-sided) | at α = 0.05 |
|---|---|---|---|
| 100 | 0.50 | 0.6171 | fail to reject |
| 1,536 | 1.9596 | 0.050044 | fail to reject |
| 1,537 | 1.9602 | 0.049969 | reject |
| 10,000 | 5.00 | < 0.0001 | reject |
Only n changed. A tiny p says the gap is probably real, not that it is big.
Anonymous check
What may the report say?
Claim: half of a country's adults favour a policy. A random survey of 200,000 adults finds 50.3% in favour. Two-sided test: z ≈ 2.68, a p-value of about 0.007.
-
Significant, but a 0.3-point gap is probably too small to matter
-
A large difference, because p is tiny
-
The survey proves the true rate is 50.3%
-
There is a 99.3% chance the claim is wrong
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Guided · t-test (hypothetical) · headings only
Are waits longer than the promised 5 minutes?
A city stated in advance it would test “longer than 5 min”. Random sample of \(n = 16\) rides: \(\bar{x} = 5.9\) min, \(s = 1.8\) min. Waits are approximately normal. \(\alpha = 0.05\).
- Your turn: all five steps. Here are steps 1 to 3 to check.
- \(H_0: \mu = 5,\quad H_a: \mu > 5,\quad \alpha = 0.05\)
- Random, approximately normal, only \(s\): t-test.
- \(\text{SE} = 1.8/\sqrt{16} = 0.45,\quad t = 0.9/0.45 = 2.00,\quad df = 15\)
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Guided · t-test (hypothetical) · find the bound yourself
Step 4: t = 2.00, df = 15, right-tailed.
\(H_a: \mu > 5\) min, \(\alpha = 0.05\).
| one tail | 0.10 | 0.05 | 0.025 | 0.01 | 0.005 | 0.0005 |
|---|---|---|---|---|---|---|
| two tails | 0.20 | 0.10 | 0.05 | 0.02 | 0.01 | 0.001 |
| df 14 | 1.345 | 1.761 | 2.145 | 2.624 | 2.977 | 4.140 |
| df 15 | 1.341 | 1.753 | 2.131 | 2.602 | 2.947 | 4.073 |
| df 16 | 1.337 | 1.746 | 2.120 | 2.583 | 2.921 | 4.015 |
- Row 15, one-tail: \(1.753 < 2.00 < 2.131\)
- 0.025 < p < 0.05 (software ≈ 0.032)
- \(p < 0.05\): reject \(H_0\). Evidence that mean waits exceed 5 minutes.
Summary · what changes and what does not
Same five steps, three tests.
| Step | z for μ (σ known) | t for μ (σ unknown) | z for p |
|---|---|---|---|
| 1 Hypotheses | \(H_0: \mu = \mu_0\), tail fixed before the data | \(H_0: p = p_0\), tail fixed before the data | |
| 2 Conditions | random; shape or n; σ known | random; shape OK for this n; only s | random; \(np_0, n(1-p_0) \ge 10\) |
| 3 Statistic | \(\dfrac{\bar x - \mu_0}{\sigma/\sqrt n}\) | \(\dfrac{\bar x - \mu_0}{s/\sqrt n}\), \(df = n - 1\) | \(\dfrac{\hat p - p_0}{\sqrt{p_0(1-p_0)/n}}\) |
| 4 p-value | z-table | t-table: a bound | z-table |
| 5 Conclude | \(p < \alpha\): reject \(H_0\); otherwise fail to reject. In context, with the size. | ||
- ?
- ?
- ?
- ?
- ?
Independent · choose the test, then all five steps (hypothetical)
Fewer than 60% in their field?
Before the survey, a college said it would test “fewer than 60%”. A random sample of 150 recent graduates: 78 work in their field. Use a 5% significance level.
On paper: name the test, then steps 1 to 5. The z-table excerpt is beside this.
| z | .00 | .01 | .02 | .03 | .04 |
|---|---|---|---|---|---|
| 1.7 | 0.9554 | 0.9564 | 0.9573 | 0.9582 | 0.9591 |
| 1.8 | 0.9641 | 0.9649 | 0.9656 | 0.9664 | 0.9671 |
| 1.9 | 0.9713 | 0.9719 | 0.9726 | 0.9732 | 0.9738 |
| 2.0 | 0.9772 | 0.9778 | 0.9783 | 0.9788 | 0.9793 |
| 2.1 | 0.9821 | 0.9826 | 0.9830 | 0.9834 | 0.9838 |
- Hypotheses
- Conditions
- Statistic
- p-value
- Conclude
Check your work
Fewer than 60% in their field?
Random sample: 78 of 150. Direction stated in advance. \(\alpha = 0.05\).
- \(H_0: p = 0.60,\quad H_a: p < 0.60\)
- A proportion, random; \(np_0 = 90\), \(n(1 - p_0) = 60\): z-test for p.
- \(\hat p = 0.52,\quad \text{SE}_0 = \sqrt{0.6 \times 0.4/150} = 0.04,\quad z = -0.08/0.04 = -2.00\)
- Row 2.0, column .00: \(p = 1 - 0.9772 = 0.0228\)
- \(p < 0.05\): reject \(H_0\). Evidence that fewer than 60% work in their field (sample: 52%).
Back to the survey · the three analysts
What may be printed.
Survey: 18 of 80 households, 22.5%. Claim tested: 15%, two-sided.
\(z \approx 1.88\), \(p \approx 0.060\): not enough evidence at the 5% level that the rate differs from 15%.
The gap: 7.5 points. 95% interval for the rate: 13.3% to 31.7%.
Analyst 2. Not “the rate is 15%”: the data fit 15% and rates well above it (13.3% to 31.7%).
Anonymous check
Which bound and decision are right?
A random sample of 6 values tests whether a mean differs from a claim, in either direction: t = 2.50. Use a 5% significance level.
| one tail | 0.10 | 0.05 | 0.025 | 0.01 | 0.005 | 0.0005 |
|---|---|---|---|---|---|---|
| two tails | 0.20 | 0.10 | 0.05 | 0.02 | 0.01 | 0.001 |
| df 4 | 1.533 | 2.132 | 2.776 | 3.747 | 4.604 | 8.610 |
| df 5 | 1.476 | 2.015 | 2.571 | 3.365 | 4.032 | 6.869 |
| df 6 | 1.440 | 1.943 | 2.447 | 3.143 | 3.707 | 5.959 |
-
0.05 < p < 0.10: fail to reject H₀
-
0.02 < p < 0.05: reject H₀
-
0.025 < p < 0.05: reject H₀
-
p ≈ 0.012 from the z-table: reject H₀
Anonymous check
What does step 2 decide?
Claim: 10% of a town's commuters cycle. A random sample of 60 commuters finds 15 who cycle.
-
Stop: np₀ = 6 is below 10
-
Run it: 15 and 45 are both at least 10
-
Fail to reject H₀
-
Run it: n = 60 is at least 30
Anonymous check
How ready are you to run a t-test or a proportion test alone?
Not a quiz: this helps plan the next class. Answers are anonymous.
-
Ready: I could run either test alone
-
Mostly: one step is still shaky
-
Not yet: I need the steps again