In Chapter 2, we tested whether a single sample mean differed from a hypothesized value. Now we extend hypothesis testing to compare two groups. The first decision you must make is whether the two samples are independent or paired.
Two samples are independent when the observations in one group have no natural connection to the observations in the other. Each data point in Group A is unrelated to any specific data point in Group B. Examples include comparing output from two different machines, test scores from two different classrooms, or defect rates from two separate suppliers.
Two samples are paired when each observation in one group is naturally linked to a specific observation in the other. The most common pairing is a before-and-after design, where the same subjects are measured twice. Other examples include matched pairs of similar units or left-versus-right measurements on the same item.
The distinction matters because paired designs remove between-subject variability, making it easier to detect a true difference. Using the wrong test can lead to incorrect conclusions — an independent test on paired data wastes statistical power, and a paired test on independent data violates assumptions.
Independent example: GreatLakes wants to compare the output (units per hour) of Machine A versus Machine B. The machines run independently with different operators, so measurements from Machine A are unrelated to those from Machine B. This calls for an independent two-sample t-test.
Paired example: GreatLakes wants to evaluate whether scheduled maintenance improves a machine’s output. They measure the same machine’s output before and after maintenance. Because both measurements come from the same machine, the data are naturally paired. This calls for a paired t-test.
The independent two-sample t-test (also called Welch’s t-test) compares the means of two unrelated groups. Unlike the pooled t-test, Welch’s version does not assume equal variances, making it the safer default choice.
=T.TEST(array1, array2, tails, 3)1 and 2 are the sample means, s1 and s2 are the sample standard deviations, n1 and n2 are the sample sizes. Type 3 in T.TEST specifies Welch’s (unequal variances).
Because the two groups may have different variances and sample sizes, the degrees of freedom for Welch’s t-test are approximated using the Welch-Satterthwaite equation. The result is typically not a whole number and is rounded down in practice. When both groups have the same sample size, df falls somewhere between n−1 and 2(n−1), depending on how different the variances are.
=T.TEST() handles df internallyWhen data are naturally paired, we reduce the problem to a one-sample t-test on the differences. For each pair, compute the difference di = beforei − afteri. Then test whether the mean difference is significantly different from zero.
=T.TEST(before, after, tails, 1) is the mean of the paired differences, sd is the standard deviation of the differences, n is the number of pairs, and df = n − 1. Type 1 in T.TEST specifies a paired test.
=STDEV.S(differences) in Excel.)
Always choose the test that matches your study design. Paired tests are more powerful when pairing is appropriate because they control for individual differences. Independent tests are required when the two groups have no natural connection. When in doubt about equal variances for independent samples, use Welch’s t-test — it is the safer default.
In this chapter, we extended hypothesis testing to two-group comparisons. Here is what you should take away:
Independent vs Paired: Use an independent t-test when the two groups are unrelated. Use a paired t-test when each observation in one group is naturally linked to an observation in the other (e.g., before/after on the same subject).
Welch’s T-Test: The default choice for independent samples. Does not assume equal variances. Uses the Welch-Satterthwaite approximation for degrees of freedom.
Paired T-Test: Reduces to a one-sample t-test on the differences. More powerful than independent tests when pairing is valid because it removes between-subject variability.
Excel: Use =T.TEST(array1, array2, tails, type) where type 1 = paired, type 3 = Welch’s independent.