Comparing two groups: two proportions and paired data

Lessons and exercises follow the school system and stay in its language.Les leçons et les exercices suivent le système scolaire et restent dans sa langue.Lektionen und Übungen folgen dem Schulsystem und bleiben in seiner Sprache.

About this lesson

Statistics (AP-aligned) › Significance tests

To save a PDF, choose “Save as PDF” in the print dialog.

Sources and credits

Written with this source as a starting point:

sedifier rewrote the text and added its own examples and exercises.

Written with AI assistance; every answer is checked by our math engine. Not yet reviewed by a teacher.

This lesson: CC BY-SA 4.0, © sedifier · All credits

Comparing two groups: two proportions and paired data

Significance tests.

Warm-up

Three quick questions from earlier lessons.

  1. Test H₀: p = 0.5 with a random sample of 100 in which p̂ = 52/100. Find the z statistic.
  2. Test H₀: p = 0.2 with n = 400 and p̂ = 28/100. Find the z statistic.
  3. A test gives a P-value of 0.05. What does it mean?
    1. If H₀ were true, a result at least as extreme as ours would happen with probability 0.05
    2. There is a 0.05 probability that H₀ is true
    3. The result is due to chance with probability 0.05

Discover

To test whether two groups have the same success rate, group A had 30 of 100 and group B 50 of 100. Under H₀ (same rate), what is the best estimate of that common rate?

  1. 0.4
  2. It cannot be estimated

Key idea

Two independent groups, or one group measured twice.

Two proportions: pooled p^=x1+x2n1+n2\hat{p} = \dfrac{x_1 + x_2}{n_1 + n_2}, z=p^1−p^2p^(1−p^)(1/n1+1/n2)z = \dfrac{\hat{p}_1 - \hat{p}_2}{\sqrt{\hat{p}(1 - \hat{p})(1/n_1 + 1/n_2)}}. Paired data (same subjects twice): a one-sample t test on the differences.

Worked example

x1=30x_1 = 30, n1=100n_1 = 100; x2=50x_2 = 50, n2=100n_2 = 100.

p^=0.4\hat{p} = 0.4
Pool.
SE≈0.069SE \approx 0.069
√(0.4 × 0.6 × 0.02).
z≈−2.89z \approx -2.89
(0.3 − 0.5)/0.069.

Your turn, guided

Your turn: 20 of 50 and 30 of 50. The pooled proportion.

0.50.5
50/100.

Practice ★

  1. To test H₀: p₁ = p₂, group 1 had 21 successes out of 82 and group 2 had 22 out of 102. Find the pooled proportion.
  2. To test H₀: p₁ = p₂, group 1 had 51 successes out of 85 and group 2 had 51 out of 105. Find the pooled proportion.
  1. 24 students take a test before and after a course. Which procedure compares the scores?
    1. A paired t test on the 24 differences (after − before)
    2. A two-sample t test treating the groups as independent
    3. A two-proportion z test

Watch out!

Practice ★★

  1. Testing H₀: p₁ = p₂ with n₁ = n₂ = 100, the pooled proportion is 3/10. Find the standard error of p̂₁ − p̂₂.

Exit ticket

Three questions to check you have got it.

  1. To test H₀: p₁ = p₂, group 1 had 21 successes out of 82 and group 2 had 22 out of 102. Find the pooled proportion.
  2. To test H₀: p₁ = p₂, group 1 had 51 successes out of 85 and group 2 had 51 out of 105. Find the pooled proportion.
  3. To test H₀: p₁ = p₂, group 1 had 32 successes out of 93 and group 2 had 53 out of 113. Find the pooled proportion.

Summary card

Comparing two groups

  • Two proportions: pooled p^\hat{p} in the SE.
  • Paired: test the differences.

Watch out: pool counts, not proportions.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. Group 1 had 41 successes out of 100 and group 2 had 26 out of 100. Find p^1−p^2\hat{p}_1 - \hat{p}_2.
Sources and credits

Written with this source as a starting point:

sedifier rewrote the text and added its own examples and exercises.

Written with AI assistance; every answer is checked by our math engine. Not yet reviewed by a teacher.

This lesson: CC BY-SA 4.0, © sedifier · All credits