Paired Samples t-Test Calculator
The paired (dependent samples) t-test compares measurements taken from the same individuals at two different times or under two different conditions. Before and after an intervention, the readings of two instruments on the same specimens, or matched case-control pairs are typical uses.
The test is really a one-sample t-test run on the difference scores: a difference is taken for each pair, and the mean of those differences is tested against zero. The calculator returns the mean and standard deviation of the differences, t and its degrees of freedom, the p-value, the confidence interval for the difference, and Cohen's d; it also builds the difference table, a histogram of the differences, and a Q-Q plot for checking the normality assumption.
Paired Samples t-Test Formulas
Difference score: dᵢ = xᵢ(after) − xᵢ(before) Hypotheses: H₀: μ_d = 0 · H₁: μ_d ≠ 0 Mean difference: d̄ = Σdᵢ / n SD of differences: s_d = √[ Σ(dᵢ − d̄)² / (n − 1) ] Standard error: SE = s_d / √n Test statistic: t = d̄ / SE, df = n − 1 Confidence int.: d̄ ± t₍₁−α/₂; n−1₎ · SE Effect size: d = d̄ / s_d
The degrees of freedom come from the number of pairs (n − 1), not from the total number of observations. Normality is required of the difference scores; the raw measurements do not have to be normal.
How to Calculate
- Paste the first measurements (before) and the second measurements (after) into separate boxes, in the same participant order.
- Make sure both lists hold the same number of values; pairs with missing data must be removed from the analysis.
- Choose how the difference is defined: to treat an increase as positive, stay with "After − Before".
- Set the hypothesis direction, the significance level (α), and the confidence level.
- Check the normality assumption for the difference scores using the Q-Q plot and the normality warning.
- Report the mean difference, t and p, the confidence interval, and Cohen's d together; use the difference table to spot participants with extreme change.
Worked Examples
Before and after a training program
The mean of 10 participants rose from 71.50 to 76.00; the mean difference is 4.50 points with a standard deviation of 2.01. With t = 7.066 and df = 9, p < 0.001 and H₀ is rejected. The 95% confidence interval for the difference runs from 3.06 to 5.94; Cohen's d = 2.235 points to a very large effect, and the correlation between the measurements is r = 0.831.
t statistic: 7.0662 · Degrees of freedom (df): 9 · p-value: p < 0.001
A measurement with no significant change
Across 8 pairs the differences are 2, −2, 2, −2, 1, 2, −2, and −1, so the mean difference is exactly 0 and the standard deviation of the differences is 1.93. With t = 0.000 and df = 7, p = 1.000 and H₀ cannot be rejected. Because the 95% confidence interval for the difference runs from −1.61 to 1.61, no real change can be claimed.
t statistic: 0.0000 · Degrees of freedom (df): 7 · p-value: p = 1.000
A one-tailed test of a decrease
With the difference defined as "Before − After", the blood pressure readings show a mean drop of 7.30 mmHg (from 148.80 to 141.50) with a standard deviation of 2.16. In the right-tailed test, t = 10.673 with df = 9 gives p < 0.001. The 95% confidence interval for the drop runs from 5.75 to 8.85 mmHg, and Cohen's d = 3.375 is a very large effect.
t statistic: 10.6734 · Degrees of freedom (df): 9 · p-value: p < 0.001