Educerie · AP · Statistics
AP Statistics 4.9
Setting Up a Test for the Difference Between Two Population Means
How can a sample of numerical measurements tell us about the mean of a whole population, and how sure can we be?
What you will learn
- Understand when the two-sample t-test is the right procedure and how to define its parameters
- Know how to write the null and alternative hypotheses in either form
- Know the three conditions and how to verify them with numbers
- Understand the difference between two independent samples and matched pairs
You must be able to
- Identify the procedure from a study description, separating two samples from matched pairs
- Define the parameters in context, with both populations
- Write the hypotheses with the direction taken from the question and the labels
- Verify randomization, the 10% condition and the sample data condition with numbers
- Explain why a failed condition stops the test
- Avoid sample means in the hypotheses
In the exam. Section I multiple choice: pick two-sample against matched pairs for a described study, pick the hypotheses, or choose the condition that fails. In Section II (Q3 and part of Q4) the set-up earns marks before any calculation: the procedure, the parameters in context, the hypotheses, and the conditions with numbers. Common slips are treating paired data as two samples, writing sample means in the hypotheses, and checking the shape of only one group.
1Two samples or matched pairs?
This decision comes from how the data were collected, not from the numbers.
- Two independent samples. Two separate groups, with different units. A treatment group and a control group, or two populations sampled separately. The test is the two-sample t-test for a difference between population means.
- Matched pairs. Each unit gives two measurements, or the units are paired. The test is the one-sample t-test for a population mean difference (Topic 4.4).
Three ways to recognize pairs:
- The same people measured twice ("before and after", "with and without").
- Two measurements on one unit (left hand and right hand, two halves of one field).
- Units deliberately paired (twins, siblings, students matched on prior score) with one in each treatment.
If none applies, and the groups are simply two piles of different units, it is a two-sample design.
Why it matters: pairing removes the variation between units. Look at Figure 1. The same eight pairs of scores are shown two ways.
Read Figure 1 in this order:
- Left. Scores run from 48 to 112. The "before" and "after" groups overlap, because people differ far more from each other than the program changes anyone.
- Right. Each person's difference (after minus before) is between 3 and 8. All are above 0.
Treated as two independent samples, the means are 73.6 and 79.1, with standard deviations near 18.5 and 18.9: the test gives and a p-value of 0.57, so no evidence of a change. Treated correctly as pairs, the differences have mean 5.5 and standard deviation 1.6, and the test gives with a p-value near 0.00003: overwhelming evidence. The wrong choice hides a clear effect.
The reverse mistake is also wrong. Two different groups of people are not pairs, and a "difference" cannot be formed.
2The parameters
For two samples, define both population means with the response variable and populations.
Example: " = the mean time, in seconds, to finish the puzzle for all students who would listen to music while solving; = the same for all students who would work in silence."
You may instead define one parameter, the difference , but say what each mean is and keep the order. Use , never : the parameters belong to the populations.
3The hypotheses
The null value is a difference of 0. The course allows two equivalent forms.
The alternative is one of
Take the direction from the question:
| The question says | Alternative |
|---|---|
| "convincing evidence that group 1 has a lower mean" | |
| "convincing evidence that group 1 has a higher mean" | |
| "convincing evidence that the means differ" |
The direction depends on which group you call 1. Decide the labels first and use them throughout. Swapping the labels reverses and .
Example: "Is the mean time lower with music than with silence?" With music as group 1, the alternative is .
4The conditions
A two-sample t-test needs three conditions.
- Randomization. The data come from two independent random samples, or from a randomized experiment with random assignment of treatments.
- The 10% condition. When sampling without replacement, and . Not needed for a randomized experiment.
- The sample data condition. Each sample has at least 30 values ( and ), or it is stated that both populations are approximately normal. If either sample has fewer than 30 values, the data in both samples should show no strong skewness and no outliers.
Write each check with its numbers. For the third, if you cite a graph, say what it shows: "the dotplot of each group is roughly symmetric with no outliers".
5Worked example: an experiment
A teacher randomly assigns 35 students to solve a puzzle while music plays, and 32 to solve it in silence. Times are in seconds. The teacher wants to know whether music lowers the mean solving time. Use .
Procedure. Two-sample t-test for a difference between population means.
Parameters. = the mean puzzle time, in seconds, of all students like these who would solve it with music. = the mean time of those who would solve it in silence.
Hypotheses.
Conditions.
- Randomization: a randomized experiment; the 10% condition is not needed.
- Sample data: and .
All three are met.
6Worked example: two samples from populations
A researcher wants to know whether the mean weekly screen time of teenagers differs between two towns. She takes an independent random sample of 50 teenagers from town A (about 4,000 teenagers) and 45 from town B (about 3,000). She plots the 50 and 45 values: roughly symmetric, no outliers.
Procedure. Two-sample t-test for a difference between population means.
Parameters. = the mean weekly screen time, in hours, of all teenagers in town A. = the same for town B.
Hypotheses. and . The question asks whether the means differ, so the alternative is two-sided.
Conditions.
- Randomization: two independent random samples.
- 10%: and .
- Sample data: and .
7When a condition fails
A random sample of 12 students from class P and 40 from class Q. The boxplot of the 12 scores in class P shows an outlier. The 40 scores in class Q are symmetric.
- Randomization: met.
- 10%: met.
- Sample data: , so both groups must show no outlier or strong skew. Class P has an outlier. Not met.
Say it and give the reason. Do not skip a failed condition and calculate anyway.
Practice questions
30 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.