Setting Up a Test for a Proportion
What a hypothesis test does, how to write the null and alternative hypotheses for a population proportion, one-sided versus two-sided alternatives, and the three conditions for a one-sample z-test.
A hypothesis test uses sample data to decide about a claim concerning a population parameter. You start by assuming the status quo, the null hypothesis, and ask whether the data give convincing evidence for the researcher’s claim, the alternative hypothesis. Setting the test up correctly, before any data are seen, is half the work.
1What a hypothesis test does
A hypothesis test is an inference procedure used to make a decision about the value of a population parameter. For one population proportion, the procedure is the one-sample z-test for a population proportion.
As with intervals, the parameter is defined in context: the parameter, the response variable, and the population. “\(p\) = the proportion of all students at the school who eat the school lunch.”
2The null and alternative hypotheses
| Null hypothesis \(H_0\) | Alternative hypothesis \(H_a\) | |
|---|---|---|
| What it is | The status quo: assumed correct unless there is convincing evidence otherwise | The claim or belief the evidence is collected for: the researcher’s claim |
| Form | \(H_0: p = p_0\) (an equality) | \(p \lt p_0\), \(p \gt p_0\), or \(p \ne p_0\) |
| Lunch example | \(p = 0.60\) | \(p \lt 0.60\) |
Here \(p_0\) is the null hypothesized value. Even when the null is thought of as “\(p \ge 0.60\),” the test is carried out at the boundary, \(p = 0.60\): if the data are convincing against 0.60, they are even more convincing against any value above it.
School lunch
A school reports that 60% of its students eat the school lunch. The student council suspects the true proportion is lower and plans to survey a random sample of 150 students. State the hypotheses, defining the parameter.
- 1Parameter: \(p\) = the proportion of all students at the school who eat the school lunch.
- 2The null hypothesis is the status quo, the school’s figure: \(H_0: p = 0.60\).
- 3The alternative is the council’s suspicion, which the evidence is collected for: \(H_a: p \lt 0.60\).
The sample proportion is known the moment the data are in, so there is nothing to test about it. Hypotheses are always statements about the population parameter \(p\).
3One-sided or two-sided
An alternative with \(\lt\) or \(\gt\) is one-sided; an alternative with \(\ne\) is two-sided. The direction comes from the investigative question, decided before the data are collected.
Left-handed students
About 10% of people are left-handed. A teacher wonders whether the proportion at her school is different, in either direction. She will sample 250 students at random. State the hypotheses.
- 1Parameter: \(p\) = the proportion of all students at the school who are left-handed.
- 2\(H_0: p = 0.10\).
- 3“Different, in either direction” calls for a two-sided alternative: \(H_a: p \ne 0.10\).
Three flawed versions
- \(H_0: \hat{p} = 0.60\), \(H_a: \hat{p} \lt 0.60\)
- \(H_0: p \lt 0.60\), \(H_a: p = 0.60\)
- After seeing \(\hat{p} = 0.64\), the council switches to \(H_a: p \gt 0.60\).
- 11. Hypotheses are about the parameter \(p\), never the statistic \(\hat{p}\), which is already known once the data are in.
- 22. The equality belongs in the null. The claim being tested belongs in the alternative.
- 33. The alternative must come from the question asked before the data, not from the data. Changing it after seeing the result makes the evidence look stronger than it is.
If the sample comes out above \(p_0\) and you then pick \(H_a: p \gt p_0\), you have let the data choose the question. The direction must come from the reason for the study. When there is no reason to expect a direction, use \(\ne\).
4Conditions for a one-sample z-test
| Condition | Check for a test |
|---|---|
| Randomization | The data come from a random sample |
| 10% condition | When sampling without replacement, \(n \le 0.10N\) |
| Normality | Expected successes \(np_0 \ge 10\) and expected failures \(n(1-p_0) \ge 10\) |
School lunch
The school has 2,100 students. For the lunch test, name the procedure and check the conditions.
- 1Procedure: a one-sample z-test for a population proportion.
- 2Randomization: the 150 students are a random sample.
- 310% condition: \(150 \le 0.10(2{,}100) = 210\).
- 4Normality: \(np_0 = 150(0.60) = 90 \ge 10\) and \(n(1 - p_0) = 150(0.40) = 60 \ge 10\).
A rare event
A company claims only 2% of its phone chargers are defective. An inspector plans to test a random sample of 200 chargers. Is a one-sample z-test appropriate?
- 1Under \(H_0: p = 0.02\), the expected number of defective chargers is \(np_0 = 200(0.02) = 4\).
- 24 is less than 10, so the normality condition fails and the null distribution of \(\hat{p}\) is not close to normal.
A test asks what would happen if \(H_0\) were true, so the normality condition uses \(p_0\): \(np_0\) and \(n(1-p_0)\). Confidence intervals, which make no assumption about \(p\), use the observed counts. Keep the two apart.
“Normality: assuming H₀ is true, the expected numbers of successes and failures are np₀ = 150(0.60) = 90 and n(1 − p₀) = 150(0.40) = 60, both at least 10.”
5Quick reference
| Step | What to write |
|---|---|
| Parameter | p = the proportion of [population] who [response], in context |
| Hypotheses | \(H_0: p = p_0\); \(H_a: p \lt p_0\), \(p \gt p_0\), or \(p \ne p_0\) |
| Procedure | One-sample z-test for a population proportion |
| Conditions | Random sample; \(n \le 0.10N\); \(np_0 \ge 10\) and \(n(1-p_0) \ge 10\) |