Mathwords logoMathwords

Two-Sample t-Interval — Definition, Formula & Example

A two-sample t-interval is a range of plausible values for the difference between two population means. You build it from two independent samples when the population standard deviations are unknown.

Given independent random samples (or two groups formed by random assignment) of sizes n1n_1 and n2n_2, with sample means xˉ1,xˉ2\bar{x}_1, \bar{x}_2 and sample standard deviations s1,s2s_1, s_2, a level-CC two-sample t-interval for μ1−μ2\mu_1 - \mu_2 is (xˉ1−xˉ2)±t∗s12/n1+s22/n2(\bar{x}_1 - \bar{x}_2) \pm t^* \sqrt{s_1^2/n_1 + s_2^2/n_2}. Here t∗t^* is the upper (1−C)/2(1-C)/2 critical value of a t-distribution. Its degrees of freedom come from the Welch–Satterthwaite approximation, or conservatively from min⁡(n1−1, n2−1)\min(n_1 - 1,\, n_2 - 1).

Key Formula

(xˉ1−xˉ2)±t∗s12n1+s22n2(\bar{x}_1 - \bar{x}_2) \pm t^* \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}
Where:
  • xˉ1,xˉ2\bar{x}_1, \bar{x}_2 = sample means of groups 1 and 2
  • s1,s2s_1, s_2 = sample standard deviations of groups 1 and 2
  • n1,n2n_1, n_2 = sample sizes of groups 1 and 2
  • t∗t^* = critical t-value for the chosen confidence level and degrees of freedom

How It Works

First check three conditions. The data must come from random samples or a randomized experiment. The two groups must be independent, and when sampling without replacement each sample should be under 10% of its population. Each sampling distribution must be approximately normal, which holds if n≥30n \ge 30 or the sample data show no strong skew or outliers. Then compute the interval. If it contains 0, a difference of zero is plausible. If it lies entirely above or below 0, the data give convincing evidence that the means differ.

Worked Example

Problem: A teacher randomly assigns 50 students to two study methods, 25 per method. Method A: mean score 82, standard deviation 15. Method B: mean score 70, standard deviation 20. Dotplots of both groups show no strong skew or outliers. Construct a 95% confidence interval for μA−μB\mu_A - \mu_B.
Step 1: Find the point estimate and the standard error.
xˉA−xˉB=82−70=12,SE=15225+20225=9+16=5\bar{x}_A - \bar{x}_B = 82 - 70 = 12, \quad SE = \sqrt{\frac{15^2}{25} + \frac{20^2}{25}} = \sqrt{9 + 16} = 5
Step 2: Use the conservative degrees of freedom, min⁡(24,24)=24\min(24, 24) = 24. From a t-table, the 95% critical value is t∗=2.064t^* = 2.064.
df=24,t∗=2.064df = 24, \quad t^* = 2.064
Step 3: Compute the margin of error and the interval.
12±2.064(5)=12±10.32  ⇒  (1.68, 22.32)12 \pm 2.064(5) = 12 \pm 10.32 \;\Rightarrow\; (1.68,\ 22.32)
Answer: (1.68, 22.32)(1.68,\ 22.32). You can be 95% confident that the true mean score for Method A is between 1.68 and 22.32 points higher than for Method B. The whole interval is above 0, and the students were randomly assigned, so this is convincing evidence that Method A causes higher mean scores. A calculator uses Welch degrees of freedom (about 44.5), which gives a slightly narrower interval.

Why It Matters

This interval is a core AP Statistics Unit 7 procedure, and free-response questions often ask whether the interval contains 0. Clinical researchers use it to estimate how much a drug lowers mean blood pressure compared with a placebo. Tech companies use it in A/B tests to compare average time spent on two website designs.

Common Mistakes

Mistake: Using a two-sample t-interval on paired data, such as before-and-after scores from the same students.
Correction: Paired measurements are not independent groups. Compute each subject's difference, then use a one-sample t-interval on those differences.

Related Terms