AP® Statistics · Unit 4 · Topic 4.9

Setting Up a Two-Sample Mean Test

A two-sample mean test compares two independent groups by assuming their true population means are equal, then checking if the observed difference is too large to be explained by chance alone.

Whenever you compare two treatments, you start from the same place: assume they do nothing different. The null hypothesis says mu1 = mu2, or equivalently mu1 - mu2 = 0, meaning any difference you see in the sample averages is just sampling variability, not a real effect. The alternative hypothesis claims a real difference exists: mu1 ≠ mu2, or mu1 > mu2, or mu1 < mu2, depending on what the question asks. This mirrors every other significance test you've built: assume nothing is going on, then measure how surprising the data would be if that were true.

Setting this up requires two independent groups, not one group measured twice. Check three conditions. Random: each group comes from a random sample or random assignment, so results generalize and causal claims are fair. Independent: observations within each group are independent of each other, usually satisfied if each group's sample is less than 10 percent of its population, and the two groups don't influence each other. Normal/Large Sample: each group's sampling distribution of the mean is approximately normal, checked through the Central Limit Theorem for large samples, roughly symmetric graphs for small samples, or stated normality in the population. Degrees of freedom get estimated by software or conservatively taken as the smaller of n1-1 and n2-1 by hand.

This setup feeds straight into the two-sample t-test itself, which uses a standard error built from both sample variances divided by their respective sample sizes. The whole point of nailing the setup first is that the test statistic and conclusion mean nothing if the data structure or conditions are wrong.

Key terms

Null hypothesis (H0)
The claim that the two population means are equal, written mu1 = mu2.
Alternative hypothesis (Ha)
The claim that the two population means differ, either in a specific direction or just not equal.
Independent groups
Two samples where the individuals in one group have no pairing or influence over individuals in the other.
Paired data
Data from the same subjects measured twice, requiring a one-sample test on the differences instead of a two-sample test.
Degrees of freedom
A value used to find the correct t-distribution, approximated by hand as the smaller of n1-1 and n2-1.

Watch it explained

  1. How it worksHow do you set up hypotheses and conditions for two independent groups of means?
  2. Worked exampleFind the hypotheses and conditions for comparing 30 treated patients to 30 controls.
  3. Common mistakeWhy isn't a two-sample test the right tool for before-and-after data on the same people?

Check yourself

Your turn1 of 2
Two independent groups have sizes 32 and 31. Find the total number of subjects across both groups.

End of topic.