Track 8 · Hypothesis Testing · Lesson 7 of 14

Two-sample t-test

Compare the means of two independent groups with Welch's t-test, report the difference with a confidence interval, and know when the pooled version applies.

35 minIntermediate7 graded exercisesMembers

A courier tried new routing software and wants to compare delivery times under the old and new systems, using separate samples of parcels from before and after the change. Do the two samples show a real difference in the mean, or could sampling variation explain the gap? This is the most common comparison in applied statistics.

Two samples are independent when the observations in one group tell you nothing about specific observations in the other: different parcels, different customers, different patients randomly assigned to two arms. The parameter is the difference of population means, μ1−μ2\mu_1 - \mu_2, usually tested against H0:μ1−μ2=0H_0: \mu_1 - \mu_2 = 0.

Included with a Formula Quest membership

It has 7 graded exercises with feedback, hints and worked solutions. After it you will be able to:

  • Compute Welch's t statistic, standard error and degrees of freedom for two independent samples
  • Prefer Welch's test to the pooled test unless equal variances are justified by design
  • Report the difference in means with its confidence interval and an effect size
  • Separate “is there a difference?” from “what causes it?” in observational comparisons