PAIRED T-TEST CALCULATOR

Paired t-test calculator

Enter matched pairs, get t and the p-value.

When do I use a paired t-test?

When each value in one list is matched with a value in the other — the same people before and after a treatment, or two measurements on the same item. The test works on the differences within each pair. Samples also count as matched when two individuals are deliberately paired, for example twins or two subjects matched on age.

How is t calculated?

t = mean difference ÷ (SD of the differences ÷ √n), with n − 1 degrees of freedom, where n is the number of pairs (OpenStax Introductory Statistics). In steps: subtract each pair (second minus first), average the differences, take their sample standard deviation, divide it by √n to get the standard error, and divide the mean difference by that. The pairs are reduced to one list of numbers and tested against a mean of 0, exactly as in a one-sample t-test.

Example

OpenStax (Example 10.11) records pain scores for eight subjects before and after hypnotism. The differences (after − before) are 0.2, −4.1, −1.6, −1.8, −3.2, −2.0, −2.9, −9.6. The mean is −3.13 and the SD 2.91, so the standard error is 2.91 ÷ √8 = 1.029 and t = −3.04 with 7 degrees of freedom. The one-sided p-value (pain is lower after) is 0.0095; the two-sided p-value is 0.0190, and the two-sided 5% critical value is ±2.36. Either way, the scores fall significantly at the 5% level.

Why not use a two-sample t-test?

Pairing removes the differences between subjects, so a paired test is usually more sensitive when the data really are matched. For two independent groups, use the two-sample t-test. Run on the same hypnotism numbers as if they came from two unrelated groups, the two-sample test gives t = 2.60 and a two-sided p-value of 0.021, against t = 3.04 and p = 0.019 for the paired test. Choose the test from how the data were collected, not from which one gives the smaller p-value.

What does the test assume?

That the differences are roughly normally distributed and the pairs are independent of each other. OpenStax adds that with a large enough number of pairs the mean difference is approximately normal even when the individual differences are not. Only the differences need to look normal, not the original measurements. With a handful of pairs, a single extreme difference can dominate the result.

Common mistakes with the paired t-test

First, putting the lists in different orders: the first value of each list must belong to the same pair, so sorting one list breaks the pairing. Second, flipping the sign: the calculator uses second minus first, so a negative t means the second measurement is lower. It lists the one-sided p-values for both directions; pick the one that matches your hypothesis before you look at the data. Third, pairing data that are not really matched, such as two groups of different people that happen to have the same size. Fourth, treating a significant p-value as a large effect: report the mean difference alongside it. If every difference is identical the standard deviation is 0 and t is undefined, so the calculator asks for differences that are not all equal.

What if the differences are far from normal?

With few pairs and strong skew or outliers, the paired t-test can mislead. The usual alternative is the Wilcoxon signed-rank test on the same differences, which ranks them instead of averaging them.

Sources: OpenStax, Introductory Statistics 2e, section 10.4 (Matched or Paired Samples, Example 10.11). Related: one-sample t-test calculator, two-sample t-test calculator, Wilcoxon signed-rank test calculator, effect size calculator and statistical power calculator.