Inference for Two Sample Means (CI and Test)
Two-sample t-interval and t-test for the difference in two population means μ1 - μ2 using independent samples.
Try the Interactive Version!
Learn step-by-step with practice exercises built right in.
📊 Inference for Two Sample Means (CI and Test)
Comparing the means of two populations—such as treatment vs. control, or two manufacturing processes—is one of the most common inference problems. We use two-sample t-procedures to estimate and test the difference .
Setting Up the Problem
Let and be the true means of two independent populations. We draw independent samples of sizes and , obtaining sample means and , and sample standard deviations and .
We focus on the difference .
Sampling Distribution of
When conditions are met:
- Mean:
- Standard error:
- Distribution: Approximately with complicated degrees of freedom (calculator handles this)
Two-Sample t-Interval for
Confidence Interval:
where and is the critical -value based on the degrees of freedom.
Degrees of Freedom (Welch's adjustment):
(Most calculators compute this automatically; always use the more conservative estimate if doing by hand.)
Two-Sample t-Test for
Null Hypothesis: (or equivalently, )
Test Statistic:
Compare to the -distribution with the appropriate df to find the p-value.
Alternative Hypotheses:
- Two-tailed:
- One-tailed: or
Conditions for Two-Sample t-Procedures
All methods require:
| Condition | Requirement |
|---|---|
| Random samples | Both samples randomly selected. |
| Independence | Samples are independent of each other; within each sample, observations are independent (10% condition if sampling without replacement). |
| Nearly Normal | Each sample is approximately Normal (large sample or no extreme outliers). For , use t-procedures even if distribution is somewhat non-normal. |
Robustness of t-Tests
t-procedures are robust to departures from Normality, especially for large samples and balanced designs (). However:
- With very small samples () and skewed data, be cautious.
- With very large samples (), slight departures from Normality are not a concern.
Worked Example 1: Two-Sample t-Interval
Two high schools compare math proficiency test scores:
- School A: , ,
- School B: , ,
Construct a 95% CI for .
Standard error:
Degrees of freedom (conservative estimate: use from smaller sample): Using and 95% confidence, .
CI:
We are 95% confident that School A's mean exceeds School B's by between −2.0 and +8.0 points.
Worked Example 2: Two-Sample t-Test
Test vs. at using the data above.
Test statistic:
p-value (two-tailed with ):
Since , we fail to reject . Insufficient evidence that the school means differ.
Common Pitfalls
⚠️ Confusing SE with : is the standard error of . Do not use the sample standard deviations directly as if they were the population SDs.
⚠️ Forgetting Independence: Two-sample t-tests require independent samples. If the samples are paired (same individuals measured twice), use a paired t-test instead.
⚠️ Misinterpreting CI: A 95% CI does not mean there is a 95% probability that is in the interval for this specific data. Rather, the method has 95% long-run success rate.
Calculator Tip
💡 TI-84 / TI-Nspire: Use 2-SampTInt for confidence intervals and 2-SampTTest for hypothesis tests. Enter the summary statistics () and the alternative hypothesis. The calculator computes df and the interval or test automatically (with or without assuming equal variances).
📚 Practice Problems
1Problem 1easy
❓ Question:
Two basketball teams have mean shooting percentages: Team A (, , ) and Team B (, , ). Construct a 90% CI for .
💡 Show Solution
Standard error:
Degrees of freedom (conservative: ): For and 90% confidence, .
CI:
We are 90% confident that Team A's mean shooting % exceeds Team B's by between −1.6% and +7.6%.
2Problem 2medium
❓ Question:
A sleep study compares two treatments: Placebo (, hours, ) and Drug (, hours, ). Test vs. at .
💡 Show Solution
Standard error:
Test statistic:
Degrees of freedom (conservative: ): For one-tailed, :
Since , we reject . Significant evidence that the drug increases sleep compared to placebo.
3Problem 3hard
❓ Question:
In a quality control study, Product A (, , ) and Product B (, , ) are compared. Calculate the 99% CI for and interpret whether the products differ significantly.
💡 Show Solution
Standard error:
Degrees of freedom (approximate, using Welch's formula or conservative ): For (or even for large samples) and 99% confidence, .
CI:
Interpretation: At 99% confidence, the true difference is between −9.286 and +5.286. Since 0 is in the interval, there is no significant difference between the products at the 0.01 level. The observed 2-unit difference in samples could easily be due to random variation.
⚠️ Common Mistakes: Inference for Two Sample Means (CI and Test)
Avoid these 3 frequent errors
Practice with Flashcards
Rate this topic's cards with spaced repetition. Cards join your deck when you finish a topic's lesson and take its exit quiz.
Browse All Topics
Explore more AP Statistics topics