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

Running the two-sample t-test and concluding

Compute the two-sample t statistic and p-value, interpret the p-value, decide, and conclude in context about two means.

In one minute

With hypotheses written and conditions checked, running the two-sample t-test means computing a test statistic, finding a p-value, comparing it to α\alpha, and writing a conclusion about the two populations. The structure matches the one-sample test, but the standard error combines both groups.

On free-response questions, much of the credit depends on the written interpretation and conclusion in context, so practice the wording as much as the arithmetic.

Key terms

Test statistic
t=(xˉ1−xˉ2)−0s12/n1+s22/n2t = \dfrac{(\bar{x}_1 - \bar{x}_2) - 0}{\sqrt{s_1^2/n_1 + s_2^2/n_2}}, the number of standard errors the observed difference lies from 0.
Standard error
s12/n1+s22/n2\sqrt{s_1^2/n_1 + s_2^2/n_2}, the estimated spread of xˉ1−xˉ2\bar{x}_1 - \bar{x}_2. Do not pool the standard deviations.
Degrees of freedom
Provided by technology; it lies between the smaller of n1−1n_1 - 1 and n2−1n_2 - 1 and n1+n2−2n_1 + n_2 - 2. Using the smaller value is the conservative choice.
p-value
The probability, assuming μ1=μ2\mu_1 = \mu_2, of a difference in sample means at least as extreme as the one observed, in the direction of HaH_a.
Significance level α\alpha
The cutoff for the decision, set before looking at the results. Reject H0H_0 when p-value ≤α\le \alpha.
Reject H0H_0
Conclude there is convincing evidence for HaH_a.
Fail to reject H0H_0
Conclude there is not convincing evidence for HaH_a. This does not show the means are equal.
Cause and effect
Supported only when treatments were randomly assigned, so the groups differ only by treatment and chance.

The test statistic and degrees of freedom

The test statistic is t=(xˉ1−xˉ2)−0s12n1+s22n2t = \dfrac{(\bar{x}_1 - \bar{x}_2) - 0}{\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}}. The "0" is the null value of μ1−μ2\mu_1 - \mu_2. The numerator is the observed gap, and the denominator is its standard error, so t says how many standard errors the observed gap is from 0.

Each group keeps its own s2/ns^2/n. Technology supplies the degrees of freedom and the p-value. If you only have a table, use the smaller of n1−1n_1 - 1 and n2−1n_2 - 1 for df. This gives a p-value that is a bit larger, so it errs on the safe side.

The p-value and its meaning

The p-value is the area in the tail or tails of the t-distribution beyond the observed t. For Ha:μ1>μ2H_a: \mu_1 > \mu_2, it is the area above t. For Ha:μ1<μ2H_a: \mu_1 < \mu_2, it is the area below. For Ha:μ1≠μ2H_a: \mu_1 \ne \mu_2, it is twice the tail area.

Interpret it in context assuming H0H_0 is true: "If the two population means are really equal, the probability of getting a difference in sample means at least this large, just by random chance, is about 0.024." It is not the probability that H0H_0 is true or that HaH_a is false.

Decision and conclusion

Compare the p-value with α\alpha. If p-value ≤α\le \alpha, reject H0H_0 and say there is convincing evidence for HaH_a. If p-value >α> \alpha, fail to reject H0H_0 and say there is not convincing evidence for HaH_a.

A strong conclusion refers to the p-value and α\alpha, names both populations or treatments, and uses wording like "convincing evidence" rather than "proves." Never "accept H0H_0." Then match the claim to the design: if the groups were randomly assigned, the conclusion can mention the treatment as the cause of the difference; if the groups came from random sampling only, generalize to the populations but do not claim cause.

Writing the conclusion
DecisionWording
p-value at most α\alphaReject H0H_0. There is convincing evidence that μ1\mu_1 is greater than (less than, different from) μ2\mu_2, in context.
p-value greater than α\alphaFail to reject H0H_0. There is not convincing evidence for HaH_a, in context.
Randomly assigned groupsThe difference can be attributed to the treatments.
Random sampling onlyGeneralize to the populations; do not claim cause.

Worked example

A school (invented numbers) compares two math practice apps. Sixty volunteers were randomly assigned: 32 to App 1 and 28 to App 2. After four weeks, scores on a common test were: App 1, xˉ1=85.2\bar{x}_1 = 85.2, s1=7.5s_1 = 7.5; App 2, xˉ2=81.0\bar{x}_2 = 81.0, s2=8.4s_2 = 8.4. Graphs of both groups show no strong skew or outliers. Test whether App 1 gives a higher mean score, using α=0.05\alpha = 0.05.

Hypotheses: μ1\mu_1 and μ2\mu_2 are the true mean test scores for students like these using App 1 and App 2. H0:μ1=μ2H_0: \mu_1 = \mu_2 and Ha:μ1>μ2H_a: \mu_1 > \mu_2. Conditions: random assignment, so no 10% check. One group has n = 28, under 30, so we rely on the graphs: neither group shows strong skew or outliers, so the normality condition is met.

Calculation: xˉ1−xˉ2=4.2\bar{x}_1 - \bar{x}_2 = 4.2. The standard error is 7.5232+8.4228=1.7578+2.52=4.2778≈2.0683\sqrt{\dfrac{7.5^2}{32} + \dfrac{8.4^2}{28}} = \sqrt{1.7578 + 2.52} = \sqrt{4.2778} \approx 2.0683. So t=4.22.0683≈2.031t = \dfrac{4.2}{2.0683} \approx 2.031, with df≈54.6df \approx 54.6 from technology. The upper-tail p-value is about 0.024.

Interpretation of the p-value: if the true mean scores for the two apps were equal, there would be only about a 2.4% chance of seeing sample means this far apart in App 1's favor, just from random assignment.

Decision: since 0.024≤0.050.024 \le 0.05, reject H0H_0. There is convincing evidence that the true mean test score is higher with App 1 than with App 2 for students like these. Because students were randomly assigned, we can attribute the difference to the app. Note that at α=0.01\alpha = 0.01 the same p-value would lead us to fail to reject, so the choice of α\alpha should be set beforehand.

How it connects

  • Back to 4.9: the hypotheses and conditions for this test must be written before this step.
  • Back to 4.5: the decision rule and conclusion wording are the same as for one mean.
  • Back to 4.8: a two-sided test at level α\alpha agrees with a (1−α)(1-\alpha) interval on whether 0 is plausible.

Common mistakes

  • Pooling standard deviations. The standard error uses s12/n1+s22/n2s_1^2/n_1 + s_2^2/n_2 with no pooling.
  • **Using df = n1+n2−2n_1 + n_2 - 2 by hand.** Technology gives the df; the table-safe choice is the smaller of n1−1n_1 - 1 and n2−1n_2 - 1.
  • Claiming cause without random assignment. Random sampling supports generalizing, not causing.
  • **Writing "accept H0H_0" or "prove HaH_a."** Use fail to reject, and convincing evidence.
  • Misreading the p-value. It assumes H0H_0 is true and is not the probability that H0H_0 is true.

How it shows up on the exam

  • Summary statistics for two groups, asking you to carry out the entire test from hypotheses to a conclusion in context.
  • Technology output (t, df, p-value) you must interpret and use to reach a decision and write a conclusion.
  • A question asking whether cause and effect can be concluded, with a reason from how the groups were formed.

Check yourself

  1. What does the t statistic of 2.031 in the worked example say in terms of standard errors?
  2. How do you interpret a p-value of 0.024 in context, assuming H0H_0 true?
  3. Would a two-sided alternative with the same data change the decision at α=0.05\alpha = 0.05? Why or why not?
  4. What are you allowed to conclude about cause in a randomized experiment, and not allowed in an observational study?

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