Analyze · Means

Paired t-Test

Compares the means of two related observations (matched pairs, before/after, repeated measures) on the same units.

In the menus Analyze › Means › Paired t-Test

Also searched as paired samples t test dependent t test dependent samples t matched pairs t test repeated measures t test before after before and after pre post

When to use it

Each row is one unit measured under two conditions or at two time points.

When not to: The two measurements come from different, unrelated units (use the two-sample t-test instead, which does not assume pairing), the within-pair differences are severely non-normal at a small sample size (use the Wilcoxon signed-rank test on the differences), or the same column is accidentally selected for both roles (refused explicitly, since pairing a column with itself produces an all-zero, meaningless difference).

Step by step

  1. Open it from the menu

    Click Analyze in the menu bar; under Means choose Paired t-Test.

  2. Fill in the form

    Choose the columns: First measurement, Second measurement. The form lists only columns whose type fits each field.

  3. Check the options

    The options start at their defaults: How strict to be, What you expect, Difference to test against, How sure the range is. Change one only when your question needs it.

  4. Run the analysis

    Press Run analysis. The Result Card opens on its Results tab.

What to choose in the form

Fields of the Paired t-Test form
First measurement X1 requiredOne numeric column. The first number for each person or item, such as a score before training. Each row holds one person's pair.
Second measurement X2 requiredOne numeric column. The second number for the same person or item, such as the score after training, in the same row.
How strict to be AlphaThe cut-off for the p-value. Below it, the card reports evidence of a difference; a smaller cut-off is stricter. Not sure? Keep 0.05. It is the usual convention in most fields.
What you expect Alternativetwo-sided: a change in either direction. less: first measurement lower. greater: first higher. Choose a direction only if decided beforehand. Not sure? Keep two-sided. It is the usual choice because it does not assume a direction.
Difference to test against Hypothesized differenceThe average change (first minus second) the test starts from. 0 asks whether there is any change at all. Not sure? Keep 0. It asks the usual question: did the values change?
How sure the range is Confidence levelThe confidence level of the range for the difference: 0.95 gives a 95% confidence interval. Not sure? Keep 0.95. It is the usual choice and matches a 0.05 cut-off.

How to read the card

The Results tab starts with what to know first (rows left out, checks that did not pass), then the interpretation in words and the Key Results; charts and assumption checks follow further down. Learn More explains the method in plain words. Read a Result Card covers all four tabs.

What it assumes

Independence of observations

If it does not hold: The pairs themselves must be independent of one another (the two measurements within a pair are naturally dependent, which is exactly what pairing accounts for); dependence BETWEEN pairs (e.g. pairs sharing a common batch or cluster) makes the standard error too small.

How to check: Not checkable from the data alone: it is a property of how the data were collected.

Normality (of residuals, not of the raw data)

If it does not hold: At small n, strong skew or outliers in the within-pair differences distort both the p-value and the confidence interval; at moderate to large n the Central Limit Theorem makes the test fairly robust.

How to check: Shapiro-Wilk for 3 <= n <= 5000, and Anderson-Darling for n >= 8 (becoming the primary verdict above n = 5000), both computed on the within-pair differences and reported directly on the card.

A worked example

Blood pressure measured on 30 patients before and after a 12-week treatment.

Result: t(29) = -4.12, p < .001, mean difference = -8.3 mmHg, 95% CI [-12.4, -4.2], Cohen's d_z = 0.75 (medium-to-large).

Blood pressure dropped significantly between the two measurements, with a medium-to-large standardized effect (without an untreated comparison group, the drop cannot by itself be attributed to the treatment rather than to time or regression to the mean), and the confidence interval places the true average reduction somewhere between about 4 and 12 mmHg; the pairing (comparing each patient to themselves) is what makes this a much more sensitive comparison than treating before and after as two separate, unrelated groups of 30 patients each.

From the Statistics Library.

The code tabs

Code gives this analysis as Python, R and MATLAB code (and SAS where the tab offers it), reading the data the way KernelStats did. Export sends the card to a report or to slides. See The Code tab.

Understand the statistics

Ask Oobi

Type one of these into Ask Oobi beside your data:

  • Did patients' blood pressure change from before to after treatment?
  • Explain the paired t-test in plain words.
  • What does Student's t distribution mean?

Last reviewed November 16, 2026.

Report an unclear step