AP Statistics · Topic 4.9 · Reading guide, about 5 min

Hypotheses and conditions for a two-sample t-test

Name the two-sample t-test, define both means, write H0 and Ha for mu1 and mu2, check conditions, and tell it apart from a paired test.

In one minute

A two-sample t-test asks whether two populations (or two treatments) have different mean values. You compare means from two separate groups, using the sample data to judge whether the gap between xˉ1\bar{x}_1 and xˉ2\bar{x}_2 is bigger than chance alone would likely produce.

The setup comes before any arithmetic: choose the right test, define both parameters, write hypotheses that match the question, and verify the conditions in context.

Key terms

Two-sample t-test
A test of a claim about μ1−μ2\mu_1 - \mu_2 using two independent samples or two randomly assigned groups, with σ1\sigma_1 and σ2\sigma_2 unknown.
Parameters μ1\mu_1 and μ2\mu_2
The true means of the two populations or treatments. Define each in words and context, with a clear first and second group.
Null hypothesis H0H_0
Says the means are equal: μ1=μ2\mu_1 = \mu_2, or equivalently μ1−μ2=0\mu_1 - \mu_2 = 0.
Alternative hypothesis HaH_a
One-sided (μ1<μ2\mu_1 < \mu_2 or μ1>μ2\mu_1 > \mu_2) or two-sided (μ1≠μ2\mu_1 \ne \mu_2), set by the research question.
Independent groups
Groups with no linking of individuals between them: separate samples, or random assignment to different treatments.
Matched pairs
Data where each observation in one set is tied to one in the other, such as two measurements on the same person. Analyze one sample of differences.
Randomized experiment
Subjects are assigned to treatments by chance. The 10% condition is not needed, and cause and effect can be supported.
Normality condition
Both n1≥30n_1 \ge 30 and n2≥30n_2 \ge 30, or both populations approximately normal, or both samples without strong skew or outliers when a sample is small.

Choosing between two-sample and paired

The design decides, not the sample sizes. Ask: is each individual in one group connected to a specific individual in the other group? If the same people are measured twice, or each subject is deliberately matched to a similar partner, the data are paired and you use a one-sample t-test on differences. If two separate groups are measured, you use a two-sample t-test.

Equal group sizes do not make data paired. Two classes of 25 students each who take the same quiz are independent groups, so two-sample methods apply. Twenty students measured before and after a program are paired, even though that gives "two sets of 20."

Defining parameters and writing hypotheses

Define both means, naming a first and second group: "Let μ1\mu_1 be the true mean number of free throws made in 60 seconds by players who use the new routine, and μ2\mu_2 the true mean for players who use the usual routine." The order matters because HaH_a points in a direction.

The null hypothesis is H0:μ1=μ2H_0: \mu_1 = \mu_2 (or μ1−μ2=0\mu_1 - \mu_2 = 0). The alternative is chosen from the question, before looking at data. "Is the new routine better?" gives Ha:μ1>μ2H_a: \mu_1 > \mu_2. "Is the new routine worse?" gives Ha:μ1<μ2H_a: \mu_1 < \mu_2. "Is there a difference?" gives Ha:μ1≠μ2H_a: \mu_1 \ne \mu_2. You may write them in difference form, such as Ha:μ1−μ2>0H_a: \mu_1 - \mu_2 > 0.

Hypotheses are always about parameters. Never write H0:xˉ1=xˉ2H_0: \bar{x}_1 = \bar{x}_2.

Alternatives for the two-sample t-test
QuestionAlternative (mean form)Alternative (difference form)
Is group 1 higher?μ1>μ2\mu_1 > \mu_2μ1−μ2>0\mu_1 - \mu_2 > 0
Is group 1 lower?μ1<μ2\mu_1 < \mu_2μ1−μ2<0\mu_1 - \mu_2 < 0
Do the groups differ?μ1≠μ2\mu_1 \ne \mu_2μ1−μ2≠0\mu_1 - \mu_2 \ne 0

Conditions

Randomization: the groups come from independent random samples of their populations, or the subjects were randomly assigned to two treatments. Without random sampling you cannot generalize to a population; without random assignment you cannot claim cause.

10% condition: if sampling without replacement, each sample is less than 10% of its population. Skip this check for a randomized experiment.

Normality or sample size: both n1≥30n_1 \ge 30 and n2≥30n_2 \ge 30, or both populations approximately normal. If either sample is below 30 and the populations' shape is unknown, graph both samples. Neither should show strong skew or outliers. Check each group, not the combined data.

Worked example: setup for a two-sample test

A coach (invented scenario) has 40 players volunteer for a study of two warm-up routines. She randomly assigns 20 to the new routine and 20 to the usual routine, and records the number of free throws each makes in 60 seconds. Dotplots of both groups are roughly symmetric, with no outliers. She wants to know whether the new routine increases the mean number of free throws.

Procedure: two-sample t-test for μ1−μ2\mu_1 - \mu_2. The groups are separate sets of players, not linked, so this is not paired.

Parameters: μ1\mu_1 is the true mean number of free throws made in 60 seconds by players like these using the new routine; μ2\mu_2 is the same for the usual routine.

Hypotheses: H0:μ1=μ2H_0: \mu_1 = \mu_2 and Ha:μ1>μ2H_a: \mu_1 > \mu_2 (one-sided, since she asks about an increase).

Conditions: players were randomly assigned, so no 10% check is needed. Both groups have n=20<30n = 20 < 30, so we use the data: the dotplots of both groups show no strong skew or outliers, so a normal model for the difference of means is reasonable. The conditions are met.

How it connects

  • Back to 4.4: the structure of hypotheses and conditions is the same, with two means in place of one.
  • Back to 4.7: the conditions are identical to those for the two-sample t-interval.
  • Forward to 4.10: with the setup complete, compute the t statistic and p-value.

Common mistakes

  • Treating equal sample sizes as paired. Pairing is about the design: each value is tied to a specific partner.
  • **Writing hypotheses with xˉ\bar{x}.** Use the parameters μ1\mu_1 and μ2\mu_2.
  • Defining parameters vaguely. Say what each mean is, for which population, in what units.
  • Checking normality for the combined data. Check each group on its own.

How it shows up on the exam

  • A study description asking whether the data are paired or independent, with a reason based on the design.
  • A request to define both parameters, state hypotheses matching a research question, and check conditions in context.
  • A graph or summary for two small samples that you must interpret as supporting or undermining the normality condition.

Check yourself

  1. Why do two classes of 25 students taking the same quiz need a two-sample test?
  2. Write H0H_0 and HaH_a for the question "Does the new fertilizer give taller plants than the old one?"
  3. Which conditions change when subjects are randomly assigned instead of randomly sampled?
  4. If group 1 has n = 14 with an outlier and group 2 has n = 40, what do you say about normality?

Practice this topic. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.