How to Run a Paired t-test

Tests whether a before-and-after measurement of the same people or items has changed. It takes the difference for each pair and tests whether the mean difference differs from zero. List the same number of values in the same order.

A paired t-test asks whether the same people, or the same items, changed between two measurements: blood pressure before and after a drug, scores before and after a course.

It takes the difference (after − before) for each pair and asks whether the mean difference differs from zero. It is a one-sample t-test applied to those differences.

t=dˉsd/nt = \dfrac{\bar{d}}{s_d / \sqrt{n}}

The degrees of freedom are n1n - 1.

Example

With the defaults, before is 62, 58, 70, 65, 74 and after is 60, 55, 66, 63, 70. The differences are 2,3,4,2,4-2, -3, -4, -2, -4, with a mean of 3-3 and a sample standard deviation of 1.

t=31/5=356.7082t = \dfrac{-3}{1 / \sqrt{5}} = -3\sqrt{5} \approx -6.7082

On 4 degrees of freedom the two-sided p-value is 0.0026. It is below 0.05, and t|t| exceeds the critical value 2.7764, so the change is real.

Why pairing matters

Feeding the same numbers to an unpaired two-sample test lets the differences between individuals leak in as noise and hide the change. Pairing removes that noise, so a paired test can find a small effect that an unpaired test would miss. If the data is paired, pairing it costs nothing and gains a great deal.

Watch out

List the same number of values in the same order: the first value of each list must belong to the same subject. Sorting one list on its own changes the answer.

A positive mean difference means an increase, a negative one a decrease. The 3-3 above means the measurement fell by 3 on average.