All AP Courses AP StatisticsAP Stats

Unit 4 · Topic 4.9 · about 20 minutes

AP Statistics 4.9: Setting Up a Test for the Difference Between Two Population Means

Recognize when two population means should be compared with a two-sample t-test, then define the parameters, state the hypotheses and verify the conditions.

Unit 4: 10 to 20% of the multiple-choice section

What you'll be able to do

  • Identify the two-sample t-test as the method for comparing two population means, and define both parameters in context.
  • Write the null and alternative hypotheses for the difference between two population means.
  • Verify the conditions that justify a hypothesis test for the difference between two population means.

Key vocabulary

TermWhat it meansThe exam trap
Two-sample t-testThe test for a difference between two population means, used with two independent random samples or the two groups of a randomized experiment.Paired data, such as left-hand and right-hand grip strength for the same people, need the one-sample t-test on the differences instead.
Null hypothesisH0:μ1−μ2=0, or equivalently H0:μ1=μ2: no difference between the population means.Writing it with sample means, x‾1=x‾2, turns it into a statement about data already in hand instead of about the populations.
Alternative hypothesisThe claim the test looks for evidence of: μ1<μ2, μ1>μ2 or μ1≠μ2, each of which can also be written with μ1−μ2 compared to 0.A claim in one direction, such as a drink that increases push-ups, needs a one-sided alternative, not ≠.
Sample data conditionBoth samples have at least 30 observations, or both populations are approximately normal. If either sample is under 30, both sample distributions should be free from strong skewness and outliers.Moderately skewed samples of 45 and 38 still meet it, because both are at least 30.
10 percent conditionWhen sampling without replacement, n1≤0.10N1 and n2≤0.10N2. It is not needed for a randomized experiment.Each sample is checked against its own population, so a combined count against one population answers the wrong question.

Predict first

A fishing-line company says its new line is stronger, on average, than its old line. An engineer will test the breaking strength of random samples of each. What does the null hypothesis say?

The test and its two parameters

To test a claim about the difference between two population means, use the two-sample t-test for a difference between two population means. It applies to two independent random samples and to the two groups of a randomized experiment.

There are two parameters, and each one needs its own definition with the population and the response variable in context: "μ1 = the mean breaking strength, in pounds, of all new line" and "μ2 = the mean breaking strength, in pounds, of all old line." For an experiment on volunteers, each population is people like those in the study receiving that treatment.

Hypotheses for the difference between two population means (two equivalent ways to write each)
The question asks whetherNull hypothesisAlternative hypothesis
mean 1 is less than mean 2H0:μ1=μ2, or μ1−μ2=0Ha:μ1<μ2, or μ1−μ2<0
mean 1 is greater than mean 2H0:μ1=μ2, or μ1−μ2=0Ha:μ1>μ2, or μ1−μ2>0
the means differH0:μ1=μ2, or μ1−μ2=0Ha:μ1≠μ2, or μ1−μ2≠0

Two groups or pairs?

The most expensive decision in this topic comes before any hypotheses. If each value in one group is linked to exactly one value in the other, because both values come from the same person or the same car, the data are paired, and the right test is the one-sample t-test for a mean difference from Topic 4.4. If the two groups were sampled or assigned separately, with no link between any particular members, use the two-sample t-test. A third kind of question compares one group with a fixed number, such as an advertised value, and that is a one-sample t-test for a mean.

Sort it

Sort each study by the kind of comparison it needs. Tap a card, then tap a bin.

Two independent groups

Matched pairs

One group vs a fixed value

The conditions

The conditions match the two-sample interval from Topic 4.7:

  • Randomization condition: two independent random samples, or a randomized experiment.
  • 10% condition: when sampling without replacement, n1≤0.10N1 and n2≤0.10N2. Not needed for a randomized experiment.
  • Sample data condition: both samples have at least 30 observations, or both populations are approximately normal. If either sample is smaller than 30, both sample distributions should be free from strong skewness and outliers.

Notice what the sample data condition does not ask. Two samples of 45 and 38 can both be moderately skewed and still meet it, because both are at least 30.

Reaction times after chewing gum, in milliseconds

CaffeineNo caffeine260280300320Reaction time (ms)

Both groups of 15 are roughly symmetric with no outliers.

Worked exampleSetting up a two-sample test

A researcher recruits 30 volunteers and randomly assigns 15 to chew caffeinated gum and 15 to chew identical-looking gum without caffeine. Ten minutes later each volunteer completes a computer reaction-time task, and the researcher records the time in milliseconds. The boxplots above show the results. Set up a test of whether caffeinated gum lowers mean reaction time.

  1. Identify the procedure. The two groups were formed by random assignment, and no volunteer is linked to any particular volunteer in the other group. Use a two-sample t-test for a difference between two population means.

  2. Define the parameters. μC = the true mean reaction time, in ms, for volunteers like these who chew caffeinated gum. μN = the true mean reaction time, in ms, for volunteers like these who chew gum without caffeine.

  3. State the hypotheses. H0:μC−μN=0 and Ha:μC−μN<0. A lower reaction time is faster, so "lowers" points the alternative below 0.

  4. Check conditions. Random: the volunteers were randomly assigned to the two kinds of gum. 10%: not needed, because this is a randomized experiment. Sample data: both groups have 15 volunteers, fewer than 30, so both boxplots must be free of strong skewness and outliers, and they are.

Answer.

A two-sample t-test of H0:μC=μN against Ha:μC<μN, with all conditions met. The calculation and conclusion are in Topic 4.10.

Check your understanding

1

A researcher selects independent random samples of 50 vegetarian and 50 non-vegetarian adults from the patients of a large clinic and records each person's LDL cholesterol level. She wants to know whether the mean LDL level differs between the two groups. Which test is appropriate?

2

A company claims that its new sports drink increases the mean number of push-ups people can do. In an experiment, volunteers are randomly assigned to drink either the sports drink or water before a push-up test. Let μD and μW be the true mean numbers of push-ups for people like these volunteers after the sports drink and after water. Which hypotheses fit the company's claim?

3

An analyst takes independent random samples of 45 houses sold last year in one large city and 38 sold in another, and plans a two-sample t-test on mean selling price. Dotplots show that both samples are moderately skewed to the right with no extreme outliers. Which statement about the sample data condition is correct?

4

Volunteers are randomly assigned to solve a set of puzzles either while listening to music or in silence, and the time to finish is recorded. The test will use H0:μ1=μ2, with group 1 the music group. Which is the best definition of μ1?

5

A two-sample t-test will compare two treatments in a randomized experiment on 60 volunteers, 30 per treatment. Which statement about the 10% condition is correct?

Practice

Practice until it is automatic

New numbers every time. Each one is checked the moment you answer, with the full working shown.

Choose the inference procedure practice page · Comparing two means practice page

Exam strategy for this topic

  • Section I, Multiple Choice: 42 questions in 90 minutes.
  • Section II, Free Response: 4 questions in 90 minutes.
  • A graphing calculator with statistical capabilities is expected on both sections.

Questions students ask

How can I tell whether two sets of numbers are paired?

Ask whether each value in one group belongs with exactly one value in the other, because both come from the same person, car or pair of twins. If they do, the data are paired. If the groups were sampled or assigned separately, they are independent.

Why is the company's claim the alternative and not the null?

The null hypothesis is the statement of no difference, which the test assumes until the data argue against it. The claim is what the test looks for evidence of, so it goes in Ha.

Why don't the hypotheses use the sample means?

Sample means are known as soon as the data are in, and they almost never come out exactly equal, even when the population means are. Hypotheses are statements about the population means.

My samples are skewed. Can I still run the test?

If both samples have at least 30 observations, yes. If either one is under 30, both sample distributions need to be free from strong skewness and outliers.

How do I choose the direction of a one-sided alternative?

Follow the question and think about what the response measures. In the gum study a lower reaction time is faster, so 'caffeinated gum lowers reaction time' becomes Ha:μC−μN<0.

What if one group is compared with a fixed number instead of a second group?

Then there is only one sample, and the right procedure is a one-sample t-test for a mean, such as phone battery life against the 20 hours a maker advertises.

Course alignment, for teachers

AP Statistics topic 4.9, Unit 4: Inference for Quantitative Data: Means.

  • Skill 2.C: Identify appropriate statistical inference methods.
  • Skill 2.E: Identify the null and alternative hypotheses.
  • Skill 4.E: Justify the use of a chosen statistical inference method by verifying conditions.