Unit 4 · Topic 4.9 Beta

Setting Up a Test for the Difference Between Two Population Means

To set up a test for two means, decide from the design whether the data are paired or two independent groups.

Practice 2: Collect DataPractice 4: Interpret Results

Part 1 · Hook

Why this matters

A coach wants to compare two running shoes with 40 runners. She can have every runner try both shoes, or split the runners into two groups. Both plans compare means, but they lead to different tests, and one of them is far better at spotting a small difference. Setting up a test for two means starts with telling the two designs apart.

Part 2 · Before you start

What this builds on

Part 3 · Prerequisite check

Quick check before you start

1. Which statement about a 95% interval for μ1−μ2\mu_1 - \mu_2 from 1.2 to 4.8 is true?

  1. It gives convincing evidence that μ1>μ2\mu_1 > \mu_2
  2. It proves μ1−μ2=3\mu_1 - \mu_2 = 3
  3. 0 is a plausible value for the difference
  4. It is about the two sample means
Show the answer

Every plausible value is positive, so μ1>μ2\mu_1 > \mu_2 is supported.

  • Correct: It gives convincing evidence that μ1>μ2\mu_1 > \mu_2:
  • It proves μ1−μ2=3\mu_1 - \mu_2 = 3:
  • 0 is a plausible value for the difference:
  • It is about the two sample means:

2. Hypotheses for a paired t test are usually

  1. H0:μd=0H_0: \mu_d = 0 and an alternative about μd\mu_d
  2. H0:x¯d=0H_0: \bar{x}_d = 0
  3. H0:μ1=μ2H_0: \mu_1 = \mu_2 for two independent samples
  4. H0:μd>0H_0: \mu_d > 0
Show the answer

The parameter is the true mean difference, and the null value is 0.

  • Correct: H0:μd=0H_0: \mu_d = 0 and an alternative about μd\mu_d:
  • H0:x¯d=0H_0: \bar{x}_d = 0:
  • H0:μ1=μ2H_0: \mu_1 = \mu_2 for two independent samples:
  • H0:μd>0H_0: \mu_d > 0:

Part 4 · See it

See it first

Left panel, paired design: five numbered runners each run in shoe A and in shoe B, and each gives one difference, A minus B; the differences form one sample, analyzed with a paired t test on the mean difference with df equal to the number of pairs minus 1. Right panel, two groups: runners are split at random into group 1 wearing shoe A and group 2 wearing shoe B, different runners in each; each group gives its own mean, standard deviation and size, analyzed with a two-sample t test on mu 1 minus mu 2, with technology df or the smaller n minus 1.
Left: a paired design measures each unit twice and analyzes one list of differences. Right: a two-sample design compares two independent groups. The design, not the data, decides the test. LevlPrep original diagram.

Part 5 · Step by step

How it works, step by step

  1. Two independent groups (two random samples, or random assignment to two treatments)the parameter is μ1−μ2\mu_1 - \mu_2 and the test is a two-sample t test
  2. Write H0:μ1−μ2=0H_0: \mu_1 - \mu_2 = 0 and HaH_a with >>, << or ≠\ne from the questiondefine μ1\mu_1 and μ2\mu_2 in context, with the order of subtraction
  3. Check random, 10% (each sample) and normal/large sample (each group)the two-sample t test can be trusted
  4. Two measurements on each unit, or matched unitsthe data are paired, so use a paired t test on the differences instead; pairing removes unit-to-unit variation

Part 6 · Key ideas

Key ideas

  • Two-sample t test: H0:μ1−μ2=0H_0: \mu_1 - \mu_2 = 0 (or μ1=μ2\mu_1 = \mu_2) against Ha:μ1−μ2>0H_a: \mu_1 - \mu_2 > 0, <0< 0 or ≠0\ne 0.
  • Define both parameters in context: "μX\mu_X = the true mean battery life of all new brand X phones".
  • Conditions for each group: random (independent random samples or random assignment), 10% (when sampling), normal/large sample.
  • Paired or two-sample is decided by the design: same units twice or matched units, paired; separate groups, two-sample.

Part 7 · Misconception

A common mistake

The wrong idea: Any study with two columns of numbers uses a two-sample t test.

What actually happens: If the two columns are linked unit by unit (before and after, twins, both shoes on the same runner), the data are paired: test the mean of the differences. A two-sample t test is for two independent groups.

Part 8 · Check yourself

Check yourself

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

Graph

Battery life of two phone brands

A consumer group bought a random sample of 15 new phones of brand X and an independent random sample of 15 of brand Y, from the hundreds of thousands sold, and ran each until its battery died while streaming video (invented data). The group asks whether brand X phones last longer on average. Brand X: mean 9.80 hours, SD 1.10; brand Y: mean 9.10 hours, SD 1.30.

6789101112battery life while streaming (hours)Brand XBrand Y

1. Which hypotheses match the consumer group's question?

  1. H0:μX−μY=0H_0: \mu_X - \mu_Y = 0, Ha:μX−μY≠0H_a: \mu_X - \mu_Y \ne 0
  2. H0:μX−μY=0H_0: \mu_X - \mu_Y = 0, Ha:μX−μY>0H_a: \mu_X - \mu_Y > 0
  3. H0:x¯X−x¯YH_0: \bar{x}_X - \bar{x}_Y=0= 0, Ha:x¯X−x¯Y>0H_a: \bar{x}_X - \bar{x}_Y > 0
  4. H0:μd=0H_0: \mu_d = 0, Ha:μd>0H_a: \mu_d > 0
Show the answer

H0:μX−μY=0H_0: \mu_X - \mu_Y = 0, Ha:μX−μY>0H_a: \mu_X - \mu_Y > 0 (equivalently μX=μY\mu_X = \mu_Y and μX>μY\mu_X > \mu_Y).

  • H0:μX−μY=0H_0: \mu_X - \mu_Y = 0, Ha:μX−μY≠0H_a: \mu_X - \mu_Y \ne 0: The question has a direction ("longer"), set before the data, so the alternative is one-sided.
  • Correct: H0:μX−μY=0H_0: \mu_X - \mu_Y = 0, Ha:μX−μY>0H_a: \mu_X - \mu_Y > 0: The null says no difference in true mean battery life; the alternative says brand X lasts longer on average.
  • H0:x¯X−x¯YH_0: \bar{x}_X - \bar{x}_Y=0= 0, Ha:x¯X−x¯Y>0H_a: \bar{x}_X - \bar{x}_Y > 0: Hypotheses use parameters, never sample means.
  • H0:μd=0H_0: \mu_d = 0, Ha:μd>0H_a: \mu_d > 0: There are no pairs here: the phones of the two brands are separate samples.

2. How should μX\mu_X be defined?

  1. The true mean battery life while streaming of all new brand X phones
  2. The mean battery life of the 15 brand X phones tested
  3. The difference in mean battery life between brand X phones and brand Y phones
  4. The battery life of a typical brand X phone
Show the answer

μX\mu_X = the true mean battery life (hours, while streaming video) of all new brand X phones; μY\mu_Y likewise for brand Y.

  • Correct: The true mean battery life while streaming of all new brand X phones: A parameter is a population value, named in context.
  • The mean battery life of the 15 brand X phones tested: That is the sample mean, 9.80 hours.
  • The difference in mean battery life between brand X phones and brand Y phones: That is μX−μY\mu_X - \mu_Y; μX\mu_X is one brand's mean.
  • The battery life of a typical brand X phone: The parameter is a mean, not one phone's value.

3. Which test fits this study?

  1. A paired t test on the 15 differences, brand X minus brand Y
  2. A one-sample t test of μX=9.10\mu_X = 9.10
  3. A two-proportion z test
  4. A two-sample t test for μX−μY\mu_X - \mu_Y
Show the answer

Two independent groups and a mean response: a two-sample t test.

  • A paired t test on the 15 differences, brand X minus brand Y: Phone 1 of brand X has no partner among the brand Y phones, so there is nothing to pair.
  • A one-sample t test of μX=9.10\mu_X = 9.10: 9.10 is a sample mean with its own variability, not a known value to test against.
  • A two-proportion z test: Battery life is quantitative, so compare means.
  • Correct: A two-sample t test for μX−μY\mu_X - \mu_Y: Two independent random samples, a quantitative response and unknown population standard deviations.

4. Each brand has only 15 phones. How is the normal/large sample condition checked?

  1. Each boxplot shows no strong skew and no outliers
  2. The two samples together have 30 phones
  3. Battery lives are normally distributed
  4. The two sample standard deviations are about equal
Show the answer

Normal/large sample, for each group: normal population, n≥30n \ge 30, or a graph without strong skew or outliers. Here, the graphs.

  • Correct: Each boxplot shows no strong skew and no outliers: Both samples are smaller than 30, so each group's graph must look roughly symmetric without outliers, as these do.
  • The two samples together have 30 phones: Each sample is checked separately; 15 is less than 30.
  • Battery lives are normally distributed: Nothing says the populations are normal, so the graphs are the evidence.
  • The two sample standard deviations are about equal: Equal spreads are not a condition for this test.

5. How is the 10% condition met?

  1. 30 phones in total is less than 10% of both brands combined
  2. The phones were randomly selected
  3. 15 is less than 10% of the phones sold, for each brand
  4. It is not needed, because this is an experiment
Show the answer

Sampling without replacement from each brand: 15<0.10N15 < 0.10 N for each brand.

  • 30 phones in total is less than 10% of both brands combined: Check each sample against its own population.
  • The phones were randomly selected: That is the random condition.
  • Correct: 15 is less than 10% of the phones sold, for each brand: Each sample is a tiny share of its own brand's hundreds of thousands of phones.
  • It is not needed, because this is an experiment: The phones were sampled, not assigned to treatments, so the 10% condition applies.

6. Which studies call for a two-sample t test? Select all that apply.

  1. Commute times of a random sample of nurses and an independent random sample of teachers
  2. Plant growth for seeds randomly assigned to two fertilizers
  3. Reaction time of 25 drivers, each tested with and without a phone call
  4. The proportion of voters in two towns who support a park
  5. Weights of 30 patients before and after a diet
Show the answer

Two-sample t: two independent groups and a quantitative response. Two measurements on the same units: paired t.

  • Correct: Commute times of a random sample of nurses and an independent random sample of teachers: Right: two independent random samples, a mean response.
  • Correct: Plant growth for seeds randomly assigned to two fertilizers: Right: two groups formed by random assignment.
  • Reaction time of 25 drivers, each tested with and without a phone call: Each driver is tested twice: paired.
  • The proportion of voters in two towns who support a park: That compares proportions, not means.
  • Weights of 30 patients before and after a diet: Before and after on the same patients: paired.

Part 9 · Summary

Summary

To set up a test for two means, decide from the design whether the data are paired or two independent groups. For two groups, define μ1\mu_1 and μ2\mu_2 in context, write H0:μ1−μ2=0H_0: \mu_1 - \mu_2 = 0 with an alternative from the question, and check random, 10% and normal/large sample for each group. This is a two-sample t test.

Part 10 · Up next

What comes next

Part 11 · Connections

Connections