Unit 3 · Topic 3.13 Beta

Carrying Out a Test for the Difference Between Two Population Proportions

A two-sample z test standardizes the observed difference with the pooled standard error, z = (p-hat_1 − p-hat_2)/(√(p_c(1 − p_c)(1/(n_1) + 1/(n_2)))) , finds the p-value in the direction of H_a , compares it with α , and concludes about the true proportions in context, never accepting H_0 .

Practice 3: Analyze DataPractice 4: Interpret Results

Part 1 · Hook

Why this matters

The recycling test is set up: H0:pN−pO=0H_0: p_N - p_O = 0, Ha:pN−pO>0H_a: p_N - p_O > 0, and the pooled proportion is 0.72. The new bin households sorted correctly 13 points more often. Now the real question: if the bin made no difference, how often would random assignment alone produce a gap that large?

Part 2 · Before you start

What this builds on

Part 3 · Prerequisite check

Quick check before you start

1. For z=2.10z = 2.10 and Ha:p>p0H_a: p > p_0, the p-value is the area

  1. to the right of 2.10
  2. to the left of 2.10
  3. in both tails beyond 2.10
  4. between −2.10-2.10 and 2.10
Show the answer

A "greater than" alternative uses the right tail.

  • Correct: to the right of 2.10:
  • to the left of 2.10:
  • in both tails beyond 2.10:
  • between −2.10-2.10 and 2.10:

2. What is the pooled proportion for 30 of 100 and 50 of 150?

  1. 0.320.32
  2. 0.3170.317
  3. 0.40.4
  4. 0.0330.033
Show the answer

30+50100+150\frac{30 + 50}{100 + 150}=80250= \frac{80}{250}=0.32= 0.32.

  • Correct: 0.320.32:
  • 0.3170.317:
  • 0.40.4:
  • 0.0330.033:

Part 4 · See it

See it first

Normal curve centered at 0 with standard error 0.052, the distribution of the difference in sample proportions if the null hypothesis is true; the observed difference 0.131 is marked and the small area to its right, the p-value of about 0.006, is shaded.
If H0H_0 is true, p^N−p^O\hat{p}_N - \hat{p}_O is centered at 0 with standard error 0.052. The observed 0.131 is far in the right tail; the shaded area is the p-value. LevlPrep original diagram.

Part 5 · Step by step

How it works, step by step

  1. Assume H0H_0: the two true proportions are equalthe difference p^1−p^2\hat{p}_1 - \hat{p}_2 is centered at 0, with standard error pc(1−pc)(1n1+1n2)\sqrt{p_c(1 - p_c)\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}
  2. Standardize the observed differencezz=(p^1−p^2)−0pc(1−pc)(1n1+1n2)= \frac{(\hat{p}_1 - \hat{p}_2) - 0}{\sqrt{p_c(1 - p_c)\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}} counts how many standard errors it lies from 0
  3. Find the area beyond zz in the direction of HaH_a (both tails for ≠\ne)that area is the p-value: how often chance alone gives a difference this extreme
  4. Compare the p-value with α\alphareject or fail to reject H0H_0, then state convincing evidence (or not) for HaH_a about the true proportions, in context

Part 6 · Key ideas

Key ideas

  • Test statistic: zz=p^1−p^2pc(1−pc)(1n1+1n2)= \frac{\hat{p}_1 - \hat{p}_2}{\sqrt{p_c(1 - p_c)\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}, with pcp_c=x1+x2n1+n2= \frac{x_1 + x_2}{n_1 + n_2}.
  • p-value: area beyond zz in the direction of HaH_a; double one tail for a two-sided test.
  • Conclusion: "Because the p-value of ... is less than (greater than) α\alpha = ..., we reject (fail to reject) H0H_0. There is (is not) convincing evidence that the true proportion ..."
  • Reject: a Type I error is possible. Fail to reject: a Type II error is possible.

Part 7 · Misconception

A common mistake

The wrong idea: A p-value of 0.13 means there is a 13% chance that the two proportions are equal.

What actually happens: The p-value is computed assuming the proportions are equal. It is the probability of a difference at least as extreme as the one observed if H0H_0 were true, not the probability that H0H_0 is true.

Part 8 · Check yourself

Check yourself

Exam-style questions. Anything you miss goes into your review queue.

Table

New recycling bins: the test

A city randomly assigned 160 volunteer households a new recycling bin and 140 the old bin. It tests H0:pN−pO=0H_0: p_N - p_O = 0 against Ha:pN−pO>0H_a: p_N - p_O > 0 at α=0.05\alpha = 0.05, where pNp_N and pOp_O are the true proportions of households like these that would sort correctly with each bin. The conditions are met. (Invented data.)
Households that sorted correctly
BinSorted correctlyHouseholdsSample proportion
New1251600.781
Old911400.650
Both216300pc=0.72p_c = 0.72

1. Write the expression for the test statistic zz, with the values substituted, then give its value to two decimal places.

Type the expression as on the exam, with the values substituted.

Show the answer

zz=0.781−0.6500.72(0.28)(1160+1140)= \frac{0.781 - 0.650}{\sqrt{0.72(0.28)\left(\frac{1}{160} + \frac{1}{140}\right)}}=0.1310.0520= \frac{0.131}{0.0520}=2.53= 2.53.

  • Answer: 0.78125−0.650.72⋅0.28(1160+1140)\frac{0.78125 - 0.65}{\sqrt{0.72 \cdot 0.28\,\left(\frac{1}{160} + \frac{1}{140}\right)}}

2. What is the p-value of the test? Give four decimal places.

Type a number. A table answer and a calculator answer are both accepted.

Show the answer

P(Z≥2.53)=0.0058P(Z \ge 2.53) = 0.0058, the area to the right of zz under the standard normal curve.

  • Answer: 0.0058

3. State the conclusion of the test in context.

Write the conclusion in context.

Show the answer

Compare, then evidence, direction and parameter in context.

  • A full-credit answer: Because the p-value of 0.0058 is less than 0.05, we reject the null hypothesis. There is convincing evidence that the true proportion of all households like these that sort their recycling correctly is greater with the new bin than with the old bin.

4. In this study, what would a Type I error be?

  1. Finding the new bin helps when it truly makes no difference
  2. Getting a sample proportion of 0.781 by chance
  3. Assigning the bins without random assignment
  4. Concluding the new bin makes no difference when it really does help
Show the answer

Type I: H0H_0 is true, but we reject it.

  • Correct: Finding the new bin helps when it truly makes no difference: Right: a Type I error rejects a true H0H_0, here finding convincing evidence that the new bin helps when it makes no difference.
  • Getting a sample proportion of 0.781 by chance: A sample result by itself is not an error. Errors are about the decision made from it.
  • Assigning the bins without random assignment: That is a flaw in design, not a Type I or Type II error.
  • Concluding the new bin makes no difference when it really does help: That is a Type II error: failing to find a real effect.

5. Two studies find the same sample proportions, 0.30 and 0.42, but the second uses samples four times as large. How does its test statistic compare?

  1. About twice as large, so the p-value is smaller
  2. The same, since the proportions are the same
  3. About four times as large, since the samples are four times as large
  4. About half as large in size
Show the answer

With the same difference, larger samples give a larger |z||z| and a smaller p-value.

  • Correct: About twice as large, so the p-value is smaller: Right: the standard error is divided by 4=2\sqrt{4} = 2, so zz doubles and the evidence is stronger.
  • The same, since the proportions are the same: The proportions set the numerator; the sample sizes set the standard error in the denominator.
  • About four times as large, since the samples are four times as large: The standard error shrinks by 4\sqrt{4}, not by 4, so zz doubles.
  • About half as large in size: Larger samples give smaller standard errors and so larger zz values, not smaller.

6. A test of H0:p1−p2=0H_0: p_1 - p_2 = 0 gives a p-value of 0.21, so the researchers fail to reject H0H_0. Which error could they have made?

  1. Both a Type I and a Type II error
  2. A Type I error: they may have rejected a true H0H_0
  3. A Type II error: missing a real difference
  4. No error, since the p-value is large
Show the answer

Fail to reject: the possible error is Type II.

  • Both a Type I and a Type II error: One decision allows one kind of error: fail to reject, so only Type II.
  • A Type I error: they may have rejected a true H0H_0: They did not reject H0H_0, so a Type I error is not possible here.
  • Correct: A Type II error: missing a real difference: Right: failing to reject a false H0H_0 is a Type II error.
  • No error, since the p-value is large: A large p-value does not show H0H_0 is true; a real difference may have gone undetected.

Part 9 · Summary

Summary

A two-sample z test standardizes the observed difference with the pooled standard error, zz=p^1−p^2pc(1−pc)(1n1+1n2)= \frac{\hat{p}_1 - \hat{p}_2}{\sqrt{p_c(1 - p_c)(\frac{1}{n_1} + \frac{1}{n_2})}}, finds the p-value in the direction of HaH_a, compares it with α\alpha, and concludes about the true proportions in context, never accepting H0H_0.

Part 10 · Up next

What comes next

Part 11 · Connections

Connections