Compare › Parametric

Paired two samples t-test

Tests whether the mean of the within-pair differences is zero. The right test for before/after or two-methods-on-same-subjects designs.

What is Paired two samples t-test?

The paired t-test takes the row-wise difference dᵢ = bᵢ − aᵢ and runs a one-sample t-test against μ₀ = 0. By collapsing each pair into a single difference, it removes between-subject variability — typically much larger than the within-subject treatment effect — and so has dramatically more power than a two-sample t-test on the same data.

The non-parametric counterpart is the Wilcoxon signed-rank test, which is rank-based on the absolute differences. Use signed-rank when the differences are heavily skewed or the sample is very small.

A common mistake: applying a two-sample t-test to paired data. This treats the two columns as independent and discards the pairing structure entirely. Always pair when the design pairs.

When should I use Paired two samples t-test?

  • Before / after measurements on the same subject.
  • Two methods (e.g. two devices, two raters) on the same samples.
  • Crossover trial with two conditions in the same patients (after washout).

What data does it need?

Two numeric columns of equal length, row-paired.

What does it report?

t, df = n − 1, two-sided p-value, mean difference + 95% CI on the difference.

What does it assume?

  • Independent pairs.
  • The within-pair differences are approximately normal (or n ≥ 30).

Formula

dᵢ = bᵢ − aᵢ; t = d̄ / (s_d / √n); df = n − 1

How do I interpret the result?

Check the distribution of the differences (not the raw columns) for normality. A skewed dᵢ is the case where Wilcoxon signed-rank is a better choice.

Pair the test with a Bland-Altman plot when the design is method-comparison — the t-test tells you about a constant bias but the BA plot reveals proportional bias or heteroscedasticity.

See also