AP Statistics · Unit 4 · Topic 4.10

    4.10 Carrying Out a Test for the Difference Between Two Population Means

    Reviewed by P V Satish, Senior Faculty of Science and Academic Consultant · PG Life Sciences, PGD Biotechnology · 20+ years teaching NEET and AP · Special interest in biotechnology, biochemistry and the basics of physics
    Updated

    In short

    The two-sample t statistic is 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}}. Find the p-value from a t-distribution with the calculator's df (2-SampTTest, unpooled) or the conservative smaller n − 1. Compare with α and conclude in context, with a scope statement based on random assignment or random sampling.

    What you need to know

    • Calculate the two-sample t statistic.
    • Find the p-value using an appropriate df.
    • Carry out a complete two-sample t-test in four steps.
    • State the scope of the conclusion from the study design.

    Worked example: an experiment

    Teaching experiment (topics 4.7–4.9): random assignment of volunteers; Method A n = 25, x̄ = 78.4, s = 8.2; Method B n = 22, x̄ = 72.9, s = 9.6; both dotplots without strong skew or outliers. Do the methods give different mean scores? α = 0.05.

    State. H₀: μ_A − μ_B = 0; Hₐ: μ_A − μ_B ≠ 0, where μ_A and μ_B are the true mean scores for students like these taught by each method.

    Plan. Two-sample t-test for μ_A − μ_B. Random assignment; both groups small but with no strong skew or outliers.

    t=78.4−72.98.2225+9.6222=5.52.62≈2.10,df≈41.6,p-value≈0.042t = \frac{78.4 - 72.9}{\sqrt{\dfrac{8.2^2}{25} + \dfrac{9.6^2}{22}}} = \frac{5.5}{2.62} \approx 2.10, \quad df \approx 41.6, \quad \text{p-value} \approx 0.042

    Conclude. Because 0.042 < 0.05, we reject H₀. There is convincing evidence that the two methods produce different mean test scores for students like these; the data suggest Method A gives higher scores. Because of random assignment, the method is the likely cause of the difference.

    At α = 0.01 the same result would not be significant, which matches the 99% interval in topic 4.8 containing 0. With the conservative df = 21, the p-value is a little larger, about 0.048, and the decision at α = 0.05 is the same.

    Worked example: two random samples

    Independent random samples of commuters: City A (n = 40) x̄ = 34.2, s = 9.1; City B (n = 35) x̄ = 29.5, s = 7.4. Is there a difference in mean commute times? H₀: μ_A − μ_B = 0, Hₐ: μ_A − μ_B ≠ 0, α = 0.05.

    Conditions: independent random samples; each sample is less than 10% of its city's commuters; both n ≥ 30. The test gives t = 4.7/1.91 ≈ 2.47 with df ≈ 72.6 and a two-sided p-value of about 0.016. Because 0.016 < 0.05, reject H₀: there is convincing evidence that the mean commute time differs between all commuters in the two cities. With random samples but no random assignment, we cannot say what causes the difference (city size, transport, jobs, and so on).

    A quick self-check

    • Is the design two separate groups? (If paired, use topic 4.5.)
    • Are both parameters defined, with the order of subtraction?
    • Did you check normality for each group?
    • Did you report t, df and the p-value?
    • Does the conclusion mention α, Hₐ and context, plus scope?

    Key terms

    Two-sample t statistic
    (x̄₁ − x̄₂)/√(s₁²/n₁ + s₂²/n₂) when H₀: μ₁ − μ₂ = 0.
    2-SampTTest
    Calculator routine giving t, df and the p-value for a two-sample t-test.
    Scope of inference
    Whether a conclusion generalises (random sampling) and supports causation (random assignment).
    Statistically significant
    A p-value below α, meaning chance alone is an unlikely explanation for the observed difference.

    Common mistakes

    • Using pooled standard deviation.

      Use the unpooled standard error √(s₁²/n₁ + s₂²/n₂).

    • Reporting only 'reject H₀'.

      Finish with a sentence about the two population means in context.

    • Claiming causation from observational samples.

      Only random assignment justifies cause and effect.

    How this topic is tested

    • Write t, df and the p-value together.
    • Include the scope sentence when the question describes the design.
    • If you use conservative df, say so.

    Practice questions

    Original AP-style multiple-choice questions. Pick an answer to see the explanation.

    1. Question 1 · SP 3 · Analyze Data

      x̄₁ − x̄₂ = 6 and the standard error is 2.5. The two-sample t statistic is:

    2. Question 2 · SP 3 · Analyze Data

      A two-sided two-sample t-test gives t = −2.40 with df = 20. The p-value is about:

    3. Question 3 · SP 4 · Interpret Results

      A two-sample t-test from random samples of two schools gives p = 0.21. The best conclusion is:

    4. Question 4 · SP 4 · Interpret Results

      In an experiment with random assignment, a two-sample t-test gives p = 0.003. What can be concluded?

    5. Question 5 · SP 3 · Analyze Data

      Which input setting should be used on 2-SampTTest for AP Statistics?

    Free-response practice

    Write your answer first, then mark it against the scoring guide.

    Inference (full test) · 5 points

    Customers were randomly assigned to a new (n = 30) or old (n = 30) website layout. Mean purchase times: new 6.8 min (s = 2.1); old 8.1 min (s = 2.6). Do the data give convincing evidence that the new layout reduces mean purchase time? α = 0.05.

    1. (a) State hypotheses and check conditions.
    2. (b) Calculate t and the p-value.
    3. (c) Conclude in context, including scope.

    Connected topics

    Frequently asked questions

    What df do I report?

    The calculator's (possibly a decimal) or the conservative smaller n − 1; both are accepted.

    Do I need to check equal variances?

    No. The unpooled test doesn't assume them.

    How is this different from the paired test?

    Here the groups are independent; a paired test analyses differences within linked pairs.

    How this shows up on the exam42 multiple-choice questions and 4 free-response questions of 10 points. See what each one asks you to do.Full-length AP Statistics practice examsUnit 4 is one of 5 units on the exam. Two timed exams in the 2027 format (42 MCQ + 4 FRQ), with explanations, scoring guides and an estimated 1–5 score. $14.99 · try 5 questions free.

    Free Unit 4 cheat sheet

    Every topic in Unit 4: Inference for Quantitative Data: Means on a few printable pages: the core idea, key terms, the two traps students fall into and what the exam asks.

    We'll use your email to tell you when new AP Statistics practice material is ready. No spam, and we'll delete it if you ask.

    Free Unit 4 practice test: 50 questions with explanations

    All topics in Unit 4: Inference for Quantitative Data: Means

    1. 4.1 Sampling Distributions for Sample Means
    2. 4.2 Constructing a Confidence Interval for a Population Mean or Population Mean Difference
    3. 4.3 Justifying a Claim Based on a Confidence Interval for a Population Mean or Population Mean Difference
    4. 4.4 Setting Up a Test for a Population Mean or Population Mean Difference
    5. 4.5 Carrying Out a Test for a Population Mean or Population Mean Difference
    6. 4.6 Sampling Distributions for the Difference Between Two Sample Means
    7. 4.7 Constructing a Confidence Interval for the Difference Between Two Population Means
    8. 4.8 Justifying a Claim Based on a Confidence Interval for the Difference Between Two Population Means
    9. 4.9 Setting Up a Test for the Difference Between Two Population Means
    10. 4.10 Carrying Out a Test for the Difference Between Two Population Means

    Other units in AP Statistics

    AP® is a trademark registered by College Board, which is not affiliated with, and does not endorse, this website.