Achievable logoAchievable logo
AP Statistics
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Resources
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. One variable data
2. Two variable data
3. Data collection
4. Probability and random variables
5. Sampling distributions
6. Categorical data
7. Quantitative data
7.1 Significance test for the difference of two means
7.2 The t distribution
7.3 Confidence intervals for the mean
7.4 Significance test for the mean
7.5 Confidence intervals for the difference of two means
7.6 Hypothesis testing errors
7.7 Paired data
8. Chi-square
9. Linear regression
Wrapping up
Achievable logoAchievable logo
7.1 Significance test for the difference of two means
Achievable AP Statistics
7. Quantitative data
Our AP Statistics course is currently in development and is a work-in-progress.

Significance test for the difference of two means

6 min read
Font
Discuss
Share
Feedback

Significance test for the difference of two means

A significance test for the difference of two means helps you decide whether an observed gap between two sample means reflects a real difference between the two population means, or whether it could reasonably be explained by natural sampling variation. This kind of test is common when comparing two groups — such as a treatment group versus a control group, two schools, or two product designs — and you want evidence about whether the underlying averages truly differ.

To run a significance test for the difference between two means, check the following:

  1. You have two independent random samples (ideally simple random samples).
  2. Each population is roughly normal, or both sample sizes are at least 30 so the Central Limit Theorem applies.
  3. If you’re sampling without replacement, each sample is less than 10% of its population.

If all three conditions are met, it’s reasonable to conduct a significance test for the difference between two means.

Hypotheses for comparing two means

Definitions
Null hypothesis (H0​)
Says there is no difference between the population means.

H0​or equivalently, H0​​:μ1​=μ2​:μ1​−μ2​=0​

Alternative hypothesis (Ha​)
Depends on the question being asked.

Ha​Ha​Ha​​:μ1​−μ2​<0(left-tailed: μ1​<μ2​):μ1​−μ2​>0(right-tailed: μ1​>μ2​):μ1​−μ2​=0(two-sided)​

Practice problem

Example:

A tech company’s human resources director claims that engineers with assigned mentors and engineers without mentors spend the same amount of time working at the company before receiving their first promotion, so the company should no longer have mentors for the engineers. One employee thinks that engineers without mentors spend more time at the company before getting their first promotion.

A statistician takes two independent random samples of engineers and records the time (in months) before the first promotion:

  • Group 1 (no mentor): 25, 28, 31, 26, 24
  • Group 2 (mentor): 18, 22, 24, 20, 19, 21

Let μ1​ be the population mean for the no-mentor group, and let μ2​ be the population mean for the mentor group.

Part a.

Is a significance test possible? What assumptions are we making?

To run the test, all three conditions for inference must be checked:

  1. Independent random samples
  2. Normality (or large samples)
  3. 10% condition (if sampling without replacement)

Solution:

(spoiler)
  1. Independent random samples: The problem states the samples are independent and random, so this condition is met (no extra assumption needed).

  2. Normality / large samples: The sample sizes are not at least 30 (they are 5 and 6), so we must assume both populations are approximately normally distributed. If that assumption is false, the test results may not be reliable.

  3. 10% condition (when sampling without replacement): The problem doesn’t give the total number of engineers in each group, so we must assume each sample is less than 10% of its population. That means assuming there are at least 50 engineers without mentors and at least 60 engineers with mentors. If either population is smaller than that, the test conclusions may not be reliable.

Part b.

Restate the parameters and the hypotheses.

The employee’s claim is that the no-mentor group waits longer, so we use a right-tailed test.

Solution:

(spoiler)
  • μ1​: the mean time to first promotion (in months) for engineers without a mentor
  • μ2​: the mean time to first promotion (in months) for engineers with a mentor

H0​Ha​​:μ1​=μ2​:μ1​>μ2​​

Part c.

Complete the test and interpret the P-value.

First, compute the sample means:

xˉ1​​=5134​=26.8 months​

xˉ2​​=6124​≈20.67 months​

The difference of sample means:

xˉ1​−xˉ2​​≈6.13​

Next, find the sample standard deviations using a TI-84:

  • Enter the data into lists.
  • Press STAT, highlight CALC, choose 1: 1-Var Stats.
  • Type L1 (2nd function 1) and press ENTER.

This gives:

s1​s2​​≈2.77≈2.16​

Compute the standard error of xˉ1​−xˉ2​:

SE​=n1​s12​​+n2​s22​​​=57.70​+64.67​​=1.54+0.778​=2.318​≈1.522​

Calculate the test statistic:

t​=SE(xˉ1​−xˉ2​)−0​=1.52226.8−20.667​=1.5226.133​≈4.03​

Compute the degrees of freedom using Welch’s approximation:

df​=n1​−1(n1​s12​​)2​+n2​−1(n2​s22​​)2​(n1​s12​​+n2​s22​​)2​=4(1.54)2​+5(0.778)2​(57.70​+64.67​)2​=42.3716​+50.605​(2.318)2​=0.71395.372​≈7.53​

To find the p-value on a TI-84, use 2nd → VARS → 6: tcdf(lower, upper, degrees of freedom).

Because this is a right-tailed test:

tcdf(4.03,1E99,7.53)​≈0.0022​

Solution:

(spoiler)

The p-value is approximately 0.0022.

Interpretation: If the population means are actually the same, then there is about a 0.22% chance of getting a sample difference as large as or larger than the one observed, just due to random sampling variation.

Part d.

Give a conclusion in context at α=0.05.

Solution:

(spoiler)

Since

0.0022​<0.05​

we reject H0​. There is strong evidence that engineers without mentors receive their first promotion later on average than engineers with mentors.

Part e.

Given your conclusion, what type of error (Type I or II) might have been made and what would the consequences of this error be?

Solution:

(spoiler)

Because we rejected H0​, the possible mistake is a Type I error.

A Type I error here would mean concluding that engineers without mentors take longer to get promoted (on average) even though the population means are actually the same.

A likely consequence is that the company would spend money to hire or maintain mentors to speed up promotions, even though mentoring doesn’t actually change the average time to promotion. That money could have been spent elsewhere.

Conditions for two-sample t-test

  • Two independent random samples
  • Each population roughly normal, or both sample sizes ≥ 30 (Central Limit Theorem)
  • Sample size < 10% of population (if sampling without replacement)

Hypotheses for comparing two means

  • Null hypothesis: H0​:μ1​=μ2​ or H0​:μ1​−μ2​=0
  • Alternative hypothesis:
    • Right-tailed: Ha​:μ1​>μ2​
    • Left-tailed: Ha​:μ1​<μ2​
    • Two-sided: Ha​:μ1​=μ2​

Test statistic and standard error

  • Test statistic: t=SE(xˉ1​−xˉ2​)−0​
  • Standard error: SE=n1​s12​​+n2​s22​​​
  • Degrees of freedom: use Welch’s approximation

Interpreting the p-value

  • P-value: probability of observed (or more extreme) difference if H0​ is true
  • Small P-value (e.g., <α): reject H0​, evidence for alternative

Types of errors

  • Type I error: reject H0​ when H0​ is true
    • Consequence: act as if means differ when they do not
  • Type II error: fail to reject H0​ when Ha​ is true

Summary

  • Two-sample t-test evaluates if sample mean difference reflects a true population mean difference
  • Requires independence, random sampling, and normality (or large samples)
  • Key formulas:
    • Test statistic: t=SE(xˉ1​−xˉ2​)−0​
    • Standard error: SE=n1​s12​​+n2​s22​​​

Sign up for free to take 8 quiz questions on this topic

Previous
Next  | 7.2 The t distribution
All rights reserved ©2016 - 2026 Achievable, Inc.

Significance test for the difference of two means

Significance test for the difference of two means

A significance test for the difference of two means helps you decide whether an observed gap between two sample means reflects a real difference between the two population means, or whether it could reasonably be explained by natural sampling variation. This kind of test is common when comparing two groups — such as a treatment group versus a control group, two schools, or two product designs — and you want evidence about whether the underlying averages truly differ.

To run a significance test for the difference between two means, check the following:

  1. You have two independent random samples (ideally simple random samples).
  2. Each population is roughly normal, or both sample sizes are at least 30 so the Central Limit Theorem applies.
  3. If you’re sampling without replacement, each sample is less than 10% of its population.

If all three conditions are met, it’s reasonable to conduct a significance test for the difference between two means.

Hypotheses for comparing two means

Definitions
Null hypothesis (H0​)
Says there is no difference between the population means.

H0​or equivalently, H0​​:μ1​=μ2​:μ1​−μ2​=0​

Alternative hypothesis (Ha​)
Depends on the question being asked.

Ha​Ha​Ha​​:μ1​−μ2​<0(left-tailed: μ1​<μ2​):μ1​−μ2​>0(right-tailed: μ1​>μ2​):μ1​−μ2​=0(two-sided)​

Practice problem

Example:

A tech company’s human resources director claims that engineers with assigned mentors and engineers without mentors spend the same amount of time working at the company before receiving their first promotion, so the company should no longer have mentors for the engineers. One employee thinks that engineers without mentors spend more time at the company before getting their first promotion.

A statistician takes two independent random samples of engineers and records the time (in months) before the first promotion:

  • Group 1 (no mentor): 25, 28, 31, 26, 24
  • Group 2 (mentor): 18, 22, 24, 20, 19, 21

Let μ1​ be the population mean for the no-mentor group, and let μ2​ be the population mean for the mentor group.

Part a.

Is a significance test possible? What assumptions are we making?

To run the test, all three conditions for inference must be checked:

  1. Independent random samples
  2. Normality (or large samples)
  3. 10% condition (if sampling without replacement)

Solution:

(spoiler)
  1. Independent random samples: The problem states the samples are independent and random, so this condition is met (no extra assumption needed).

  2. Normality / large samples: The sample sizes are not at least 30 (they are 5 and 6), so we must assume both populations are approximately normally distributed. If that assumption is false, the test results may not be reliable.

  3. 10% condition (when sampling without replacement): The problem doesn’t give the total number of engineers in each group, so we must assume each sample is less than 10% of its population. That means assuming there are at least 50 engineers without mentors and at least 60 engineers with mentors. If either population is smaller than that, the test conclusions may not be reliable.

Part b.

Restate the parameters and the hypotheses.

The employee’s claim is that the no-mentor group waits longer, so we use a right-tailed test.

Solution:

(spoiler)
  • μ1​: the mean time to first promotion (in months) for engineers without a mentor
  • μ2​: the mean time to first promotion (in months) for engineers with a mentor

H0​Ha​​:μ1​=μ2​:μ1​>μ2​​

Part c.

Complete the test and interpret the P-value.

First, compute the sample means:

xˉ1​​=5134​=26.8 months​

xˉ2​​=6124​≈20.67 months​

The difference of sample means:

xˉ1​−xˉ2​​≈6.13​

Next, find the sample standard deviations using a TI-84:

  • Enter the data into lists.
  • Press STAT, highlight CALC, choose 1: 1-Var Stats.
  • Type L1 (2nd function 1) and press ENTER.

This gives:

s1​s2​​≈2.77≈2.16​

Compute the standard error of xˉ1​−xˉ2​:

SE​=n1​s12​​+n2​s22​​​=57.70​+64.67​​=1.54+0.778​=2.318​≈1.522​

Calculate the test statistic:

t​=SE(xˉ1​−xˉ2​)−0​=1.52226.8−20.667​=1.5226.133​≈4.03​

Compute the degrees of freedom using Welch’s approximation:

df​=n1​−1(n1​s12​​)2​+n2​−1(n2​s22​​)2​(n1​s12​​+n2​s22​​)2​=4(1.54)2​+5(0.778)2​(57.70​+64.67​)2​=42.3716​+50.605​(2.318)2​=0.71395.372​≈7.53​

To find the p-value on a TI-84, use 2nd → VARS → 6: tcdf(lower, upper, degrees of freedom).

Because this is a right-tailed test:

tcdf(4.03,1E99,7.53)​≈0.0022​

Solution:

(spoiler)

The p-value is approximately 0.0022.

Interpretation: If the population means are actually the same, then there is about a 0.22% chance of getting a sample difference as large as or larger than the one observed, just due to random sampling variation.

Part d.

Give a conclusion in context at α=0.05.

Solution:

(spoiler)

Since

0.0022​<0.05​

we reject H0​. There is strong evidence that engineers without mentors receive their first promotion later on average than engineers with mentors.

Part e.

Given your conclusion, what type of error (Type I or II) might have been made and what would the consequences of this error be?

Solution:

(spoiler)

Because we rejected H0​, the possible mistake is a Type I error.

A Type I error here would mean concluding that engineers without mentors take longer to get promoted (on average) even though the population means are actually the same.

A likely consequence is that the company would spend money to hire or maintain mentors to speed up promotions, even though mentoring doesn’t actually change the average time to promotion. That money could have been spent elsewhere.

Key points

Conditions for two-sample t-test

  • Two independent random samples
  • Each population roughly normal, or both sample sizes ≥ 30 (Central Limit Theorem)
  • Sample size < 10% of population (if sampling without replacement)

Hypotheses for comparing two means

  • Null hypothesis: H0​:μ1​=μ2​ or H0​:μ1​−μ2​=0
  • Alternative hypothesis:
    • Right-tailed: Ha​:μ1​>μ2​
    • Left-tailed: Ha​:μ1​<μ2​
    • Two-sided: Ha​:μ1​=μ2​

Test statistic and standard error

  • Test statistic: t=SE(xˉ1​−xˉ2​)−0​
  • Standard error: SE=n1​s12​​+n2​s22​​​
  • Degrees of freedom: use Welch’s approximation

Interpreting the p-value

  • P-value: probability of observed (or more extreme) difference if H0​ is true
  • Small P-value (e.g., <α): reject H0​, evidence for alternative

Types of errors

  • Type I error: reject H0​ when H0​ is true
    • Consequence: act as if means differ when they do not
  • Type II error: fail to reject H0​ when Ha​ is true

Summary

  • Two-sample t-test evaluates if sample mean difference reflects a true population mean difference
  • Requires independence, random sampling, and normality (or large samples)
  • Key formulas:
    • Test statistic: t=SE(xˉ1​−xˉ2​)−0​
    • Standard error: SE=n1​s12​​+n2​s22​​​

More from Quantitative data

  • The t distribution
  • Confidence intervals for the mean
  • Significance test for the mean
  • Confidence intervals for the difference of two means
  • Hypothesis testing errors