Prob and StatsInference

Testing a Claim about a Proportion

Carry out a one-proportion z test.

Not started Jump to practice

Now carry out a complete test for a proportion, using the logic of significance tests. The steps are always the same: hypotheses, conditions, test statistic, p-value, conclusion in context.

Key idea

To test $H_0: p = p_0$: $$z = \dfrac{\hat{p} - p_0}{\sqrt{\dfrac{p_0(1 - p_0)}{n}}}.$$ The p-value is the area beyond z in the direction of $H_a$ (both tails if $H_a$ is $\ne$). Conditions: a random sample, and $np_0 \ge 10$ and $n(1 - p_0) \ge 10$.

Why it works

The test asks how surprising $\hat{p}$ would be if $H_0$ were true. In that world the true proportion is $p_0$, so the sampling distribution of $\hat{p}$ is centered at $p_0$ with SD $\sqrt{p_0(1 - p_0)/n}$, computed with $p_0$, not $\hat{p}$. (A confidence interval has no claimed value to use, which is why it uses $\hat{p}$.) The z-score measures how many of those SDs $\hat{p}$ sits from $p_0$.
The one-sided p-value for z = 1.85 is the area to the right.

Worked example: A complete test

Last year 30% of students walked to school. This year, in a random sample of 200 students, 72 walk. Is there convincing evidence that the proportion has gone up? Use $\alpha = 0.05$. ($P(Z < 1.85) = 0.9678$.)
  1. Hypotheses: $H_0: p = 0.3$, $H_a: p > 0.3$, where $p$ is this year's proportion of all students who walk.
  2. Conditions: random sample; $200(0.3) = 60$ and $200(0.7) = 140$ are at least 10.
  3. $\hat{p} = \dfrac{72}{200} = 0.36$. SD under $H_0$: $\sqrt{\dfrac{0.3 \times 0.7}{200}} \approx 0.0324$.
  4. $z = \dfrac{0.36 - 0.3}{0.0324} \approx 1.85$.
  5. p-value: $$P(Z > 1.85) = 1 - 0.9678 = 0.0322$$
  6. $0.0322 < 0.05$: reject $H_0$. There is convincing evidence that more than 30% of students walk this year.

Answer: z ≈ 1.85, p-value ≈ 0.032: reject $H_0$.

Worked example: A one-sided test the other way

A seed company claims 85% of its seeds sprout. A gardener plants 400 and 328 sprout. Test the claim against $H_a: p < 0.85$ at $\alpha = 0.05$. ($P(Z < -1.68) = 0.0465$.)
  1. $\hat{p} = \dfrac{328}{400} = 0.82$. SD under $H_0$: $\sqrt{\dfrac{0.85 \times 0.15}{400}} \approx 0.01785$.
  2. $z = \dfrac{0.82 - 0.85}{0.01785} \approx -1.68$.
  3. p-value: $P(Z < -1.68) = 0.0465$, just below 0.05.
  4. Reject $H_0$: there is convincing (though not overwhelming) evidence that fewer than 85% sprout.

Answer: z ≈ −1.68, p-value ≈ 0.047.

Common mistake

Writing the hypotheses about the sample statistic: "$H_0: \hat{p} = 0.3$." We already know $\hat{p} = 0.36$; there is nothing to test about it. Hypotheses are always about the population parameter $p$. Check that your hypotheses use $p$ and the claimed value, never the sample result.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • OpenStax, Introductory Statistics 2e, section 9.6 Hypothesis Testing of a Single Mean and Single Proportion
  • OpenStax, Introductory Statistics 2e, section 9.3 Distribution Needed for Hypothesis Testing
@teddyrookbook GitHub