Vertex Learn

Comparing populations

What this lesson covers

  • The interval is for the difference between groups.
  • An interval that excludes zero supports a difference.
  • Experiments use randomisation tests.
Key idea

Look for zero

  • Each line is an interval for mean A minus mean B.
  • Where zero falls tells you what you can claim.
Three intervals against a zero line: one all above zero, one crossing zero and one all below zero.
Worked example

Reading the difference

  • Mean of A minus mean of B.
IntervalContains 0?Conclusion
1.2 to 5.8NoA is likely higher
−1.1 to 3.4YesNo clear difference
Key idea

Observational or experimental

  • Observational data can suggest a difference between groups.
  • A randomised experiment can support a claim about cause.
  • A randomisation test asks how often chance alone gives so large a difference.
Key idea

Statistics explorer

Worked example

Building a difference interval

  • Group A: mean 52, s = 10, n = 100. Group B: mean 47, s = 10, n = 100.
  1. difference = 52 − 47 = 5
  2. standard error = √(100/100 + 100/100) = √2
  3. margin = 1.96 × 1.414 = 2.77
  4. 2.23 to 7.77
Key idea

Try it: bootstrap the difference

Key idea

Try it: clear zero

Worked example

A randomisation test

  • An experiment shows a difference of 6 between groups. Shuffle the labels 1000 times and count how often chance gives a difference of 6 or more.
  1. 12 of 1000 shuffles reach 6
  2. tail proportion = 12 ÷ 1000 = 0.012
  3. Chance alone rarely does this
  4. Evidence the treatment made a difference
Key idea

Try it: a randomisation test

Common mistakes

  • Saying zero in the interval proves no difference.
    It means the data cannot show one.
  • Claiming cause from a survey.
    Only random allocation supports cause.

Your turn

1

The difference interval is 2.1 to 6.3. What can you say?

2

The difference interval is −1 to 3. What can you say?

3

A tail proportion is 0.01. What does it suggest?

4

Which study can support a claim of cause?

5

Mean A is 63 and mean B is 58. The margin for the difference is 3.2. Find the interval for A minus B.

6

An interval for mean Auckland commute minus mean Wellington commute is −6.4 to −2.0 minutes. What can you say?

7

In a randomised experiment, 310 of 1000 label shuffles give a difference at least as big as the one observed. What does this suggest?

8

A: mean 45, s = 9, n = 81. B: mean 40, s = 12, n = 48. Find the 95% interval for A minus B.

Show answer

1. The first group is likely higher 2. No clear difference 3. Chance is an unlikely explanation 4. A randomised experiment 5. 1.8 to 8.2. The difference is 63 − 58 = 5, and 5 ± 3.2 gives 1.8 to 8.2. 6. Wellington commutes are likely longer on average: the whole interval is below zero, so Auckland minus Wellington is likely negative. 7. Chance alone could easily explain the difference: the tail proportion is 310 ÷ 1000 = 0.31, which is not rare. 8. 1.08 to 8.92. Standard error = √(81/81 + 144/48) = √4 = 2, margin = 1.96 × 2 = 3.92, and 5 ± 3.92 gives 1.08 to 8.92.

Your turn

Sample question: Achieved

Random samples of Year 13 students in Whangārei (A) and Invercargill (B) are asked how many hours of screen time they have on a Saturday. The 95% confidence interval for mean A − mean B is −3.2 to −0.8 hours. What can you conclude?

Hint

Check whether zero is inside the interval, and which way round the subtraction goes.

Answer

Zero is not in the interval and the whole interval is negative, so Invercargill's mean is likely higher, by between 0.8 and 3.2 hours.

Step by step
  1. The interval is for mean A minus mean B, so read the sign carefully.
  2. Is zero inside −3.2 to −0.8? No. Both ends are below zero.
  3. Every believable value of A − B is negative, so A is smaller than B.
  4. That means Invercargill (B) students likely have a higher mean Saturday screen time.
  5. Turn the numbers round for B − A: B is higher by between 0.8 and 3.2 hours.
  6. Classic mistake: reading the negative interval as A being higher. A negative difference means the second group is bigger.
Full working
  1. interval for A − B: −3.2 to −0.8
  2. 0 not inside; all negativeA − B < 0
  3. B − A: 0.8 to 3.2 hours
  4. Invercargill mean likely higher by 0.8 to 3.2 hours
Your turn

Sample questions: Merit

1

Random samples of households in Hamilton and Tauranga record weekly electricity use. Hamilton: n = 50, mean 135 kWh, s = 20 kWh. Tauranga: n = 80, mean 128 kWh, s = 24 kWh. Build a 95% confidence interval for the difference in means (Hamilton − Tauranga) using difference ± 1.96 × √(s₁²n₁ + s₂²n₂), and state what it shows.

Hint

Square each standard deviation and divide by its own sample size before adding.

Answer

−0.64 to 14.64 kWh. Zero is inside the interval, so the data do not show a difference in mean weekly use between Hamilton and Tauranga households.

Step by step
  1. Start with the difference in sample means: 135 − 128 = 7 kWh.
  2. The standard error combines the variation of both samples: √(s₁²n₁ + s₂²n₂).
  3. Hamilton part: 20² ÷ 50 = 400 ÷ 50 = 8.
  4. Tauranga part: 24² ÷ 80 = 576 ÷ 80 = 7.2.
  5. Add, then take the square root: √(8 + 7.2) = √15.2 = 3.899.
  6. Classic mistake: adding the standard deviations, 20 + 24. You add the variances divided by n.
  7. Margin: 1.96 × 3.899 = 7.64 kWh.
  8. Interval: 7 − 7.64 = −0.64 and 7 + 7.64 = 14.64.
  9. Zero is inside −0.64 to 14.64. So a mean difference of zero is believable.
  10. Conclusion: the data cannot show a difference. That is not the same as proving the means are equal.
Full working
  1. difference = 135 − 128 = 7
  2. SE = √(40050 + 57680) = √15.2 = 3.899variances over n, added
  3. margin = 1.96 × 3.899 = 7.64
  4. 7 − 7.64 = −0.64, 7 + 7.64 = 14.64
  5. 0 is insideno clear difference
  6. −0.64 to 14.64 kWh; no clear difference
2

24 volunteers are randomly allocated, 12 to solve a puzzle with music playing and 12 in silence. The mean time in silence is 52 s and with music 58 s. The group labels are re-randomised 1000 times, and 214 of the re-randomised differences are 6 s or more. Find the tail proportion and write a conclusion.

Hint

The tail proportion is the fraction of re-randomisations at least as large as the real difference; a large one means chance alone could explain it.

Answer

Tail proportion 0.214. Chance alone gave a difference of 6 s or more about 1 time in 5, so chance is a plausible explanation and the experiment does not give evidence that music slows these volunteers down.

Step by step
  1. The observed difference is 58 − 52 = 6 seconds, music slower.
  2. The re-randomisation asks: if music made no difference, how often would shuffling the labels give a difference this big?
  3. Tail proportion = 214 ÷ 1000 = 0.214.
  4. That is about 1 in 5. Chance alone produces a gap of 6 s quite often.
  5. Small tail proportions, usually under about 0.1, are taken as evidence. 0.214 is well above that.
  6. So chance is a plausible explanation for the 6 s difference.
  7. Write it in context: the experiment does not provide evidence that music increases puzzle time for these volunteers.
  8. Classic mistake: saying the experiment proves music has no effect. The test just cannot rule chance out.
  9. Had the tail proportion been small, random allocation would have let us claim music caused the slower times, but only for these volunteers.
Full working
  1. observed difference = 58 − 52 = 6 s
  2. tail proportion = 214 ÷ 1000 = 0.214
  3. 0.214 is largechance often gives 6 s or more
  4. chance is a plausible explanation
  5. 0.214; no evidence that music changes puzzle time
Your turn

Sample questions: Excellence

1

Two populations have about the same standard deviation, 15, and equal-sized random samples of n are taken from each. The difference in sample means turns out to be 4. Using difference ± 1.96 × √(s₁²n₁ + s₂²n₂), find the smallest n for which the 95% interval would exclude zero. If the samples come from a survey, explain what could and could not then be claimed.

Hint

The interval excludes zero when the margin is less than the difference, so solve 1.96 × √(450 ÷ n) < 4.

Answer

n = 109 in each group. Then the interval excludes zero and supports a difference between the population means, but a survey is observational, so it cannot show that the grouping variable causes the difference.

Step by step
  1. The interval is 4 ± margin. It leaves out zero only if the margin is less than 4.
  2. With s = 15 in both groups and n in each, the standard error is √(225n + 225n) = √(450 ÷ n).
  3. So we need 1.96 × √(450 ÷ n) < 4.
  4. Divide by 1.96: √(450 ÷ n) < 2.0408.
  5. Square: 450 ÷ n < 4.1649, so n > 450 ÷ 4.1649 = 108.05.
  6. n must be a whole number bigger than 108.05, so n = 109.
  7. Check n = 108: margin = 4.0008, a hair over 4, so the interval just reaches zero. Check n = 109: margin = 3.98, under 4.
  8. Now the claim. With n = 109 the interval is about 0.02 to 7.98, all above zero. That supports a real difference between the population means.
  9. But a survey only observes the groups. Nobody allocated people to them, so other variables could explain the difference.
  10. So the survey supports a difference, not a cause. Only a randomised experiment could support cause.
Full working
  1. need 1.96 × √(450 ÷ n) < 4margin smaller than the difference
  2. √(450 ÷ n) < 2.0408
  3. n > 450 ÷ 4.1649 = 108.05
  4. n = 108: margin 4.0008; n = 109: margin 3.98round up
  5. survey: a difference, not a causeno random allocation
  6. n = 109 in each group
2

Study 1: a random sample of 200 Year 12 students in Otago finds those who play sport daily sleep a mean of 8.1 hours and others 7.6 hours; the 95% interval for the difference is 0.2 to 0.8 hours. Study 2: 40 volunteers at one Dunedin school are randomly allocated to a 20-minute daily exercise routine or none for a month; the exercise group sleeps 0.4 hours more, and a randomisation test gives a tail proportion of 0.03. A headline says "Exercise makes New Zealand teenagers sleep longer". Use both studies to evaluate the headline.

Hint

Random selection lets you extend to a population; random allocation lets you claim a cause. Check which study has which.

Answer

Neither study supports the headline on its own. Study 1 was randomly selected, so it supports a difference for Otago Year 12 students, but it is observational, so other variables could explain it. Study 2 used random allocation and a small tail proportion, so it supports exercise causing longer sleep, but only for these 40 volunteers. Together they suggest exercise may help, but the claim about all NZ teenagers goes beyond both.

Step by step
  1. Split the headline into two parts: a cause (makes) and a population (New Zealand teenagers).
  2. Study 1. The difference interval 0.2 to 0.8 is all above zero, so it supports a real difference in mean sleep.
  3. Study 1 was a random sample, so the result extends to Otago Year 12 students.
  4. But Study 1 is observational: students chose whether to play sport. A confounder could explain it, for example students who play sport may have less late-night screen time.
  5. So Study 1 gives an association for Otago Year 12s, not a cause.
  6. Study 2. The tail proportion 0.03 is small, so chance is not a plausible explanation of the 0.4-hour gap.
  7. Study 2 used random allocation, which tends to balance confounders. So it supports exercise causing longer sleep.
  8. But Study 2 used 40 volunteers from one school. Volunteers may differ from other teenagers, so the cause claim applies to them.
  9. Neither study had both random selection from all NZ teenagers and random allocation.
  10. Judgement: the headline goes too far. The studies together suggest exercise may help sleep, but a randomised experiment on a random sample of NZ teenagers would be needed.
Full working
  1. headline: a cause, for all NZ teenagers
  2. Study 1: 0.2 to 0.8, excludes 0difference supported
  3. Study 1: random selection, observationalassociation, Otago Year 12s
  4. Study 2: tail proportion 0.03chance unlikely
  5. Study 2: random allocation, volunteerscause, these 40 only
  6. headline not supported by either study alone
Summary

What to take away

  • Look for zero.
  • Design decides what you can claim.

Challenge

1

A report compares one-way commute times from random samples of workers in Wellington and Christchurch. It gives the Wellington sample (n = 60, mean 34 minutes, s = 12 minutes) and the Christchurch sample size (n = 40), and the 95% confidence interval for the difference in means, Wellington − Christchurch, as 2.08 to 9.92 minutes. The Christchurch mean and standard deviation are missing. (a) Find them. (b) A newspaper says "Wellington commutes are 6 to 10 minutes longer." Evaluate this.

Hint

The difference in sample means is the middle of the interval, and the margin is half its width. The margin is 1.96 × √(s₁²n₁ + s₂²n₂); work backwards to the missing s₂.

Answer

(a) Christchurch mean 28 minutes, s = 8 minutes. (b) Not justified: the data support Wellington's mean being longer by somewhere between about 2 and 10 minutes. 6 minutes is only the sample difference, and values from 2 to 6 are just as plausible.

Step by step
  1. The middle of 2.08 and 9.92 is 6, so the sample difference is 6 minutes and Christchurch's mean is 34 − 6 = 28 minutes.
  2. The margin is (9.92 − 2.08) ÷ 2 = 3.92, so the standard error is 3.92 ÷ 1.96 = 2.
  3. Square it: s₁²n₁ + s₂²n₂ = 4. Wellington gives 144 ÷ 60 = 2.4, so s₂² ÷ 40 = 1.6 and s₂² = 64, s₂ = 8.
  4. The interval says the true difference in means is plausibly anywhere from 2.08 to 9.92 minutes.
  5. The paper took the sample difference as the lower end, which ignores the whole lower half of the interval. It should say between about 2 and 10 minutes longer, on average.
Full working
  1. (2.08 + 9.92) ÷ 2 = 6sample difference
  2. 34 − 6 = 28 minutesChristchurch mean
  3. (9.92 − 2.08) ÷ 2 = 3.92; 3.92 ÷ 1.96 = 2margin, then standard error
  4. 12²60 + s₂²40 = 2² = 4square the standard error
  5. 2.4 + s₂²40 = 4, s₂² = 1.6 × 40 = 64solve
  6. s₂ = 8 minutessquare root
  7. Mean 28 minutes, s = 8 minutes; the claim should be about 2 to 10 minutes longer on average
2

Six netball players volunteer to test a new warm-up. Three are randomly allocated to it and three do the usual warm-up. Increase in vertical jump (cm): new warm-up 9, 7, 5; usual warm-up 6, 4, 2. (a) Find the observed difference in means. (b) Instead of 1000 random shuffles, list every possible way to split the six results into two groups of three, and find the exact tail proportion for a difference of at least the observed one. (c) What do you conclude? (d) Explain why this experiment could never give strong evidence, whatever the results.

Hint

There are 20 ways to choose which three results are labelled "new". The six results add to a fixed total, so a bigger "new" group total means a bigger difference: you only need the triples whose total is at least 21.

Answer

(a) 3 cm. (b) 2 of the 20 splits give a difference of 3 cm or more, so the tail proportion is 2 ÷ 20 = 0.1. (c) Chance alone gives a difference this large 1 time in 10, so chance is a plausible explanation: no clear evidence the new warm-up helps. (d) Even the most extreme result (the three best all in the new group) has tail proportion 1 ÷ 20 = 0.05, so with only six players the evidence can never be strong. More volunteers are needed.

Step by step
  1. Means: new (9 + 7 + 5) ÷ 3 = 7 and usual (6 + 4 + 2) ÷ 3 = 4, so the difference is 3 cm.
  2. The six results add to 33. If the "new" group totals T, the difference is (T − (33 − T)) ÷ 3, which is 3 or more exactly when T ≥ 21.
  3. Of the 20 possible triples, only 9 + 7 + 6 = 22 and 9 + 7 + 5 = 21 reach 21. The next best, 9 + 6 + 5, is only 20.
  4. So the tail proportion is 2 ÷ 20 = 0.1. A difference this large happens 1 time in 10 by chance alone, which is not unusual.
  5. The best possible split has proportion 1 ÷ 20 = 0.05, so a six-person experiment can at most give borderline evidence.
Full working
  1. 7 − 4 = 3 cmobserved difference in means
  2. total = 33; difference = (2T − 33) ÷ 3T = new group total
  3. (2T − 33) ÷ 3 ≥ 3 gives T ≥ 21condition
  4. triples with T ≥ 21: {9, 7, 6} = 22, {9, 7, 5} = 21all others 20 or less
  5. number of splits = 20choose 3 of 6
  6. tail proportion = 2 ÷ 20 = 0.1exact
  7. smallest possible = 1 ÷ 20 = 0.05most extreme split
  8. Difference 3 cm, tail proportion 0.1, chance is plausible; six players can never give strong evidence
3

Independent random samples of university students in Dunedin and Palmerston North give 95% confidence intervals for the mean hours of paid work in four weeks of term: Dunedin 50.0 to 58.0 hours, Palmerston North 44.5 to 50.5 hours. A student writes: "The intervals overlap, so there is no evidence of a difference between the two cities." Use the two intervals to build the 95% confidence interval for the difference in means (Dunedin − Palmerston North), and evaluate the student's claim.

Hint

Each interval's margin is 1.96 × s ÷ √n, so it tells you 1.96 × that group's standard error. The difference interval's margin is 1.96 × √(s₁²n₁ + s₂²n₂). Write it using the two margins.

Answer

6.5 ± 5, that is 1.5 to 11.5 hours. Zero is not inside, so the data do support Dunedin's mean being higher. The student is wrong: overlapping intervals do not mean no difference, because the margin for a difference (5) is less than the sum of the two margins (7).

Step by step
  1. Middles: Dunedin 54 and Palmerston North 47.5, so the sample difference is 6.5 hours. Margins: 4 and 3.
  2. Each margin is 1.96 × that group's standard error, so 1.96 × √(s₁²n₁ + s₂²n₂) = √(4² + 3²).
  3. √(16 + 9) = √25 = 5, so the difference interval is 6.5 − 5 to 6.5 + 5, that is 1.5 to 11.5 hours.
  4. Zero is outside, so the data support a higher mean in Dunedin, by between 1.5 and 11.5 hours per four weeks.
  5. The overlap check is too strict: it acts as if the margin were 4 + 3 = 7, but uncertainties combine like the sides of a right-angled triangle, giving only 5.
Full working
  1. Dunedin: 54 ± 4; Palmerston North: 47.5 ± 3middles and margins
  2. 54 − 47.5 = 6.5sample difference
  3. 1.96 × SE₁ = 4, 1.96 × SE₂ = 3margin = 1.96 × SE
  4. 1.96 × √(SE₁² + SE₂²) = √(4² + 3²) = √25 = 5margin of the difference
  5. 6.5 − 5 = 1.5, 6.5 + 5 = 11.5interval
  6. 5 < 4 + 3 = 7why overlap is too strict
  7. 1.5 to 11.5 hours; excludes zero, so the claim is wrong

More challenge problems

Science

Where science uses this

Worksheet with answersWithout answersDownload PDF
Report a mistake

More in AS 91582

Is your child on track?

Take the free placement test