---
title: "Same decision. Two means. | FiveStudy"
description: "A two-sample t-test still compares a p-value to α. The new work is building t from two sample means, reading df from technology or the conservative shortcut, and writing the conclusion about both popu"
url: https://fivestudy.com/guides/apstats-4-10-carrying-out-a-two-mean-test
---

[AP Statistics](https://fivestudy.com/ap-statistics) · Study guide

# Same decision. Two means.

[Figure: FiveStudy]

FiveStudy

AP® Statistics · Unit 4 · Inference for Quantitative Data: Means

AP® Statistics · Unit 4 · Inference for Quantitative Data: Means

# Carrying Out a Test for a *Difference* in Means

How to compute the two-sample t statistic and p-value, interpret the p-value, and write a conclusion in context about the difference between two population means.

1. The test statistic 2. The p-value 3. The conclusion 4. Two more tests

The idea in one paragraph

Assume the population means are equal. Measure how far the observed difference \(\bar{x}_1 - \bar{x}_2\) is from 0 in standard errors: that is the two-sample t statistic. The p-value is the area beyond it, in the direction of Hₐ, under a t-distribution whose degrees of freedom come from technology. A small p-value is convincing evidence that the means differ.

## 1 The test statistic

\[ t = \frac{(\bar{x}_1 - \bar{x}_2) - 0}{\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}} \]

When the null hypothesis is true, this statistic has a t-distribution. Technology finds its degrees of freedom, which fall between the smaller of \(n_1 - 1\) and \(n_2 - 1\) and \(n_1 + n_2 - 2\). Without technology, use the smaller \(n - 1\): it gives a slightly larger, more cautious p-value (0.0026 instead of 0.0009 for the fertilizer data).

**Figure 1.** If the fertilizers produce the same mean height, differences in sample means vary around 0 with standard error 0.573 cm. The observed 2.1 cm is 3.67 standard errors above 0, so the right-tail p-value is only 0.0009.

## 2 The p-value

The p-value comes from the t-distribution using a table or technology. It is the probability of a test statistic as extreme as or more extreme than the one observed, in the direction of Hₐ, assuming H₀ is true, that is, assuming the two population means are equal.

Worked Example 1 Interpret the p-value

### Two fertilizers

Interpret the p-value of 0.0009.

1. 1Start from H₀ in context: the two fertilizers give the same mean height.
2. 2Then the observed difference, the direction of Hₐ, and the group sizes.

**Answer:** Assuming that the true mean heights after 4 weeks are the same for both fertilizers, there is a 0.0009 probability of getting a difference in sample means (A minus B) of 2.1 cm or more in groups of 10 and 10.

Say it like this

“Assuming that the true mean heights after 4 weeks are the same for both fertilizers, there is a 0.0009 probability of getting a difference in sample means (A minus B) of 2.1 cm or more in groups of 10 and 10.”

**Figure 2.** If fertilizer made no difference, each seedling would have grown the same in either group, and only the random assignment would separate the groups. Shuffling shows that assignment alone almost never produces a 2.1 cm gap: 0 times in 1,000, in line with the p-value of 0.0009.

Common Mistake 1 · Reading the p-value as the chance the fertilizers are equal

0.0009 is computed assuming the means are equal. It describes how unusual the data would be under that assumption, not the probability that the assumption is true.

## 3 The decision and the conclusion

Compare the p-value with α: if the p-value ≤ α, reject \(H_0: \mu_1 - \mu_2 = 0\); if the p-value \(\gt\) α, fail to reject it. State the conclusion in context, in terms of Hₐ, with non-definitive language, naming both populations or treatments.

Worked Example 2 A complete two-sample t-test

### Two fertilizers

Twenty seedlings were randomly assigned to fertilizer A or B, 10 each. After 4 weeks: \(\bar{x}_A = 25.2\) cm, \(s_A = 1.35\); \(\bar{x}_B = 23.1\) cm, \(s_B = 1.20\); dotplots of both groups show no strong skewness or outliers. Do the data give convincing evidence at \(\alpha = 0.05\) that A produces taller seedlings?

1. 1 **State.** \(H_0: \mu_A - \mu_B = 0\), \(H_a: \mu_A - \mu_B \gt 0\), where \(\mu_A\), \(\mu_B\) are the true mean heights after 4 weeks of seedlings like these with fertilizer A and B. \(\alpha = 0.05\).
2. 2 **Plan.** Two-sample t-test for a difference between two population means. Randomization: random assignment. Sample data: both groups are under 30, and neither shows strong skewness or outliers.
3. 3 **Do.** \(SE = \sqrt{1.35^2/10 + 1.20^2/10} \approx 0.573\). \(t = \dfrac{(25.2 - 23.1) - 0}{0.573} \approx 3.67\). Technology: df ≈ 17.8, p-value ≈ 0.0009.
4. 4 **Conclude.** Because the p-value of 0.0009 is less than \(\alpha = 0.05\), we reject \(H_0\). There is convincing evidence that fertilizer A produces a greater mean height after 4 weeks than fertilizer B for seedlings like these.

**Answer:** Reject H₀. Because the fertilizers were randomly assigned, the evidence supports a cause and effect conclusion for seedlings like these.

On the calculator

STAT, TESTS, **2-SampTTest**. Enter the summary statistics (Inpt: Stats) or two data lists, choose μ1 > μ2, set **Pooled: No**, Calculate. Fertilizer data: t = 3.667, p = 0.0009, df = 17.76.

Common Mistake 2 · Choosing Pooled: Yes

Pooling assumes the two populations have exactly equal standard deviations, which is rarely known. The unpooled two-sample t-test does not need that assumption; leave Pooled set to No.

## 4 Two more tests

Worked Example 3 A two-sided test with two random samples

### Commute times

Independent random samples of 40 students at School A and 45 at School B: \(\bar{x}_A = 24.6\), \(s_A = 8.4\); \(\bar{x}_B = 18.7\), \(s_B = 6.1\) minutes. Test \(H_0: \mu_A = \mu_B\) against \(H_a: \mu_A \ne \mu_B\) at \(\alpha = 0.05\).

1. 1Conditions: independent random samples; 40 ≤ 120 and 45 ≤ 90; both samples have at least 30.
2. 2\(SE \approx 1.610\), \(t = 5.9/1.610 \approx 3.67\), df ≈ 70.4.
3. 3Two-sided: p-value \(= 2P(t \ge 3.67) \approx 0.0005\).

**Answer:** Because the p-value of 0.0005 is less than α = 0.05, we reject H₀. There is convincing evidence that the true mean commute times of all students at School A and School B differ.

Common Mistake 3 · Concluding that the school causes longer commutes

The commute data come from random samples, not random assignment. The test gives convincing evidence that the two schools’ mean commute times differ, and the result generalizes to all students at the two schools, but it says nothing about why.

Worked Example 4 A test that fails to reject

### Study app

Sixty-eight students were randomly assigned to use a study app (35) or not (33). Quiz scores: app \(\bar{x} = 78.4\), \(s = 9.2\); no app \(\bar{x} = 77.0\), \(s = 10.1\). Is there convincing evidence at \(\alpha = 0.05\) that the app raises the mean score?

1. 1\(H_0: \mu_{\text{app}} - \mu_{\text{no}} = 0\), \(H_a: \mu_{\text{app}} - \mu_{\text{no}} \gt 0\). Random assignment; both groups have at least 30.
2. 2\(SE = \sqrt{9.2^2/35 + 10.1^2/33} \approx 2.35\), \(t = 1.4/2.35 \approx 0.60\), df ≈ 64.5.
3. 3p-value \(= P(t \ge 0.60) \approx 0.276\).

**Answer:** Because the p-value of 0.276 is greater than α = 0.05, we fail to reject H₀. There is not convincing evidence that using the study app increases the mean quiz score for students like these.

**Figure 3.** For the study app, the observed difference is only 0.60 standard errors above 0. Over a quarter of random assignments would produce a gap at least this large if the app had no effect, so the data are not convincing.

Common Mistake 4 · Concluding that the app has no effect

A p-value of 0.276 means a gap of 1.4 points is easy to get by chance. It does not show the app is useless; a modest benefit is still plausible. Write “there is not convincing evidence that the app increases the mean score.”

### Quick reference

| Step | What to write |
| --- | --- |
| Test statistic | \(t = [(\bar{x}_1 - \bar{x}_2) - 0] / \sqrt{s_1^2/n_1 + s_2^2/n_2}\) |
| Degrees of freedom | Technology (between smaller \(n - 1\) and \(n_1 + n_2 - 2\)); conservative: smaller \(n - 1\) |
| p-value | t-distribution tail(s) in the direction of Hₐ |
| Interpretation | Assuming [equal means in context], there is a [p] probability of getting a difference in sample means of [value] or more in groups of [n₁] and [n₂]. |
| Conclusion | There is (not) convincing evidence that [Hₐ in context]. |
| Calculator | 2-SampTTest, Pooled: No |

FiveStudy AP® Statistics · Carrying out a test for a difference in means
