Unit 4 · Topic 4.10 Beta

Carrying Out a Test for the Difference Between Two Population Means

A two-sample t test computes t = (x-bar_1 − x-bar_2)/(√(s_1²/n_1 + s_2²/n_2)) , finds the p-value from the t distribution with technology or conservative df in the direction of H_a , and concludes about μ_1 − μ_2 in context.

Practice 3: Analyze DataPractice 4: Interpret Results

Part 1 · Hook

Why this matters

Volunteers who drank caffeine reacted in 241 milliseconds on average; those who drank a caffeine-free look-alike took 262. Random assignment made the groups comparable, so if the gap is real, caffeine caused it. Is a 21 millisecond gap bigger than chance would produce? The two-sample t test answers that.

Part 2 · Before you start

What this builds on

Part 3 · Prerequisite check

Quick check before you start

1. For a two-sample t test, the null hypothesis is usually

  1. H0:μ1−μ2=0H_0: \mu_1 - \mu_2 = 0
  2. H0:x¯1−x¯2H_0: \bar{x}_1 - \bar{x}_2=0= 0
  3. H0:μd=0H_0: \mu_d = 0
  4. H0:μ1−μ2>0H_0: \mu_1 - \mu_2 > 0
Show the answer

No difference in the true means, written with parameters.

  • Correct: H0:μ1−μ2=0H_0: \mu_1 - \mu_2 = 0:
  • H0:x¯1−x¯2H_0: \bar{x}_1 - \bar{x}_2=0= 0:
  • H0:μd=0H_0: \mu_d = 0:
  • H0:μ1−μ2>0H_0: \mu_1 - \mu_2 > 0:

2. The standard error of x¯1−x¯2\bar{x}_1 - \bar{x}_2 is

  1. s12n1+s22n2\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}
  2. s1n1+s2n2\frac{s_1}{\sqrt{n_1}} + \frac{s_2}{\sqrt{n_2}}
  3. s1−s2n1+n2\frac{s_1 - s_2}{\sqrt{n_1 + n_2}}
  4. s12+s22\sqrt{s_1^2 + s_2^2}
Show the answer

Each variance over its own nn, added, then the square root.

  • Correct: s12n1+s22n2\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}:
  • s1n1+s2n2\frac{s_1}{\sqrt{n_1}} + \frac{s_2}{\sqrt{n_2}}:
  • s1−s2n1+n2\frac{s_1 - s_2}{\sqrt{n_1 + n_2}}:
  • s12+s22\sqrt{s_1^2 + s_2^2}:

Part 4 · See it

See it first

The t distribution with 40.0 degrees of freedom, centered at 0. A dashed line marks the observed two-sample t statistic -2.31, and the small area to its left is shaded: the one-sided p-value, 0.0132.
If caffeine had no effect, the two-sample t statistic would follow (approximately) the t distribution with technology df 40.0. The observed t=−2.31t = -2.31 leaves 0.0132 in the left tail: the p-value. LevlPrep original diagram.

Part 5 · Step by step

How it works, step by step

  1. Assume H0H_0: the true means are equal, μ1−μ2=0\mu_1 - \mu_2 = 0differences in sample means vary around 0 with standard error s12n1+s22n2\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}
  2. Measure the observed difference in standard errorstt=(x¯1−x¯2)−0s12n1+s22n2= \frac{(\bar{x}_1 - \bar{x}_2) - 0}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}
  3. Find the tail area in the direction of HaH_awith technology df, or the conservative df (smaller n−1n - 1), which gives a slightly larger p-value
  4. Compare with α\alpha and conclude in contextthen say what the design allows: cause and effect (random assignment) or generalizing (random sampling)

Part 6 · Key ideas

Key ideas

  • Two-sample t statistic: tt=(x¯1−x¯2)−0s12n1+s22n2= \frac{(\bar{x}_1 - \bar{x}_2) - 0}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}.
  • p-value: left tail for <<, right tail for >>, twice the smaller tail for ≠\ne; technology df, or the conservative df (also accepted).
  • Conclusion: "Because the p-value of 0.0132 is less than 0.05, we reject H0H_0. There is convincing evidence that the true mean ... with caffeine is less than without ..."
  • Choosing the procedure: proportion or mean? one sample, paired, or two independent groups? interval or test?

Part 7 · Misconception

A common mistake

The wrong idea: A p-value of 0.274 shows the two counties have the same mean exercise time.

What actually happens: A large p-value means the observed difference is the kind chance alone often produces. It is not convincing evidence of a difference, and it is not evidence that the means are equal.

Part 8 · Check yourself

Check yourself

Exam-style questions. Anything you miss goes into your review queue.

Table

Caffeine and reaction time

Forty-two adult volunteers were randomly assigned to drink a caffeinated drink (C, 20 people) or an identical-tasting caffeine-free drink (N, 22 people). Thirty minutes later each did a reaction-time task (invented data). Dotplots of both groups show no strong skew or outliers. The researchers test H0:μC−μN=0H_0: \mu_C - \mu_N = 0 against Ha:μC−μN<0H_a: \mu_C - \mu_N < 0 at α=0.05\alpha = 0.05, where μC\mu_C and μN\mu_N are the true mean reaction times with and without caffeine for adults like these.

Reaction times in milliseconds
GroupnMeanSD
Caffeine (C)2024128
No caffeine (N)2226231

1. Write the expression for the test statistic. Type it as on the exam, for example (a - b)/sqrt(s^2/m + r^2/n).

Type the expression as on the exam, with the values substituted.

Show the answer

tt=(x¯C−x¯N)−0sC2nC+sN2nN= \frac{(\bar{x}_C - \bar{x}_N) - 0}{\sqrt{\frac{s_C^2}{n_C} + \frac{s_N^2}{n_N}}}=241−26228220+31222= \frac{241 - 262}{\sqrt{\frac{28^2}{20} + \frac{31^2}{22}}}=−219.10= \frac{-21}{9.10}=−2.31= -2.31.

  • Answer: 241−26228220+31222\frac{241 - 262}{\sqrt{\frac{28^{2}}{20} + \frac{31^{2}}{22}}}

2. What is the p-value of the test?

Type a number. A table answer and a calculator answer are both accepted.

Show the answer

t=−2.31t = -2.31 with technology df 40.0 gives pp=P(t<−2.31)= P(t < -2.31)=0.0132= 0.0132. With the conservative df 19, p=0.0163p = 0.0163; both are accepted and both are below 0.05.

  • Answer: 0.0132

3. State the conclusion at α=0.05\alpha = 0.05 (p=0.0132p = 0.0132).

Write the conclusion in context.

Show the answer

p is below alpha: reject H0H_0 and state the evidence for HaH_a about the difference in true means, in context.

  • A full-credit answer: Because the p-value of 0.0132 is less than 0.05, we reject the null hypothesis. There is convincing evidence that the true mean reaction time with caffeine is less than without caffeine, for adults like these.

4. What does the design let the researchers conclude?

  1. Caffeine causes faster mean reaction time for adults like these volunteers
  2. Caffeine speeds reactions for each adult in the population
  3. Just an association, because the sample sizes are under 30
  4. Nothing, because the groups have different sizes
Show the answer

Random assignment: cause and effect. Random sampling (absent): generalizing to a population.

  • Correct: Caffeine causes faster mean reaction time for adults like these volunteers: Random assignment supports cause and effect. The volunteers were not a random sample, so the result applies to adults like them.
  • Caffeine speeds reactions for each adult in the population: Volunteers were not randomly sampled from a population, and a test is about means, not every adult.
  • Just an association, because the sample sizes are under 30: Sample size affects conditions, not whether cause and effect can be claimed.
  • Nothing, because the groups have different sizes: Unequal group sizes are fine for a two-sample t test.

5. A teacher measures each of 28 students' quiz scores before and after a review game and asks whether scores rise on average. Which procedure fits?

  1. A two-sample t test comparing before and after scores
  2. A paired t test on the 28 differences
  3. A two-proportion z test
  4. A one-sample t test on the after scores alone
Show the answer

Same individuals measured twice: paired t test, H0:μd=0H_0: \mu_d = 0, Ha:μd>0H_a: \mu_d > 0 with dd = after minus before.

  • A two-sample t test comparing before and after scores: The two sets of scores come from the same students, so they are not independent.
  • Correct: A paired t test on the 28 differences: Each student gives two linked scores, so test the mean of the after minus before differences.
  • A two-proportion z test: Scores are quantitative; the parameter is a mean difference.
  • A one-sample t test on the after scores alone: The before scores carry the comparison.

6. A researcher compares the proportion of adults who exercise at least 3 hours a week in two counties, using independent random samples. Which procedure fits?

  1. A two-sample t test for μ1−μ2\mu_1 - \mu_2
  2. A paired t test
  3. A two-sample z test for p1−p2p_1 - p_2
  4. A one-sample t test for each county
Show the answer

Choosing the procedure: categorical response, two groups, so a two-sample z test for proportions. Quantitative response, two independent groups: two-sample t test.

  • A two-sample t test for μ1−μ2\mu_1 - \mu_2: The question is about a proportion, not a mean number of hours.
  • A paired t test: The two samples are independent, and the response is categorical.
  • Correct: A two-sample z test for p1−p2p_1 - p_2: The response is "at least 3 hours or not", a categorical variable, so compare proportions.
  • A one-sample t test for each county: Two separate tests do not compare the counties.

Part 9 · Summary

Summary

A two-sample t test computes tt=x¯1−x¯2s12/n1+s22/n2= \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{s_1^2/n_1 + s_2^2/n_2}}, finds the p-value from the t distribution with technology or conservative df in the direction of HaH_a, and concludes about μ1−μ2\mu_1 - \mu_2 in context. Random assignment allows a causal conclusion; random samples allow generalizing.

Part 10 · Up next

What comes next

Part 11 · Connections

Connections