Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 39 ยท Hypothesis Tests

Paired-Samples t Test in SPSS

Compare two related measurements in SPSS with the paired-samples t test: data layout, menu path, syntax, the three output tables, effect size and reporting.

When the same people are measured twice (before and after training), or when cases are matched in pairs (twins, left and right hand), the two measurements are related. The paired-samples t test handles this by working on the difference within each pair. Because each person acts as their own control, it is usually more powerful than an independent test on the same numbers.

When to use it

  • Two measurements of one scale variable on the same cases, or on matched pairs.
  • The differences between the paired values are roughly normal. (The raw scores do not have to be.)
  • Pairs are independent of other pairs.

Data layout: two columns, one row per person

This is the reverse of the independent test. Each row holds one person, with the first measurement in one column (pre) and the second in another (post). No grouping variable exists.

id pre post
1 54 61
2 60 66
3 48 55

The idea

The test subtracts each pair, then runs a one-sample t test on the differences against zero:

t = mean(d) / (SD(d) / sqrt(n)), with n - 1 df, where d = post - pre for each pair.

Python Stand-in: a paired test is a one-sample test on differences

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Running it in SPSS

  1. Analyze > Compare Means > Paired-Samples T Test.
  2. In the dialog, click on post and pre in the variable list and move them into the first Variable 1 / Variable 2 pair. The order sets the sign: SPSS computes Variable 1 minus Variable 2, so put post first if you want improvement to be positive.
  3. Options: 95% confidence interval; missing values "Exclude cases analysis by analysis".
  4. Paste to see:
Text
T-TEST PAIRS=post WITH pre (PAIRED)
  /CRITERIA=CI(.95)
  /MISSING=ANALYSIS.

Version 27 and later has an extra Estimate effect sizes checkbox. Several pairs can be tested in one run by adding rows to the Paired Variables list.

Reading the output

SPSS gives three tables (four with effect sizes).

  1. Paired Samples Statistics: Mean, N, Std. Deviation, Std. Error Mean for each measurement.
  2. Paired Samples Correlations: the correlation between the two measurements. It should be positive and large; this is what makes the paired design strong. A correlation near 0 means pairing gained little.
  3. Paired Samples Test: Mean, Std. Deviation and Std. Error Mean of the differences, the 95% CI of the difference, t, df and Sig. (2-tailed).
  4. Paired Samples Effect Sizes (27+): Cohen's d based on the standard deviation of the differences, plus Hedges' correction.

Cases with a missing value on either measurement are dropped from that pair, so check N.

Python Stand-in: why pairing is stronger

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Never analyse paired data as independent: it breaks the independence assumption even if it happens to give a smaller p.

Effect size and reporting

For paired data the common effect size is d(z): the mean difference divided by the standard deviation of the differences. Report it with the interval from the output.

"Scores rose from before (M = 56.9) to after training (M = 62.6), mean increase 5.7, 95% CI [4.4, 6.9], t(11) = 9.97, p < .001, d = 2.9." These come from the stand-in data above; add the SDs and use the values in your own tables.

Assumptions

  • Plot the differences: compute diff = post - pre with Transform > Compute Variable, then draw a histogram (Graphs > Chart Builder, see Chart Builder). Strong skew or outliers in the differences point to the Wilcoxon signed-rank test (Analyze > Nonparametric Tests > Legacy Dialogs > 2 Related Samples), covered in non-parametric tests.
  • More than two time points call for repeated-measures ANOVA (Analyze > General Linear Model > Repeated Measures), which is beyond a paired t test.

Design warning

Before-and-after designs without a control group cannot prove the treatment caused the change: practice effects, regression to the mean and time can all move the scores. Statistical significance is not causation.

Common mistakes

  • Putting pre and post into the independent-samples dialog.
  • Leaving data in long form (two rows per person) without restructuring first (Data > Restructure).
  • Reading the sign of the mean difference without noting the order of the variables.
  • Forgetting that missing data on one measure drops the whole pair.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does the paired-samples t test actually analyse?

    It reduces each pair to a difference and tests whether the mean difference is zero.
  2. 2. In the Paired-Samples dialog, the variables are entered as post then pre. What is the mean difference?

    SPSS subtracts the second variable from the first.
  3. 3. Which data layout does the test need?

    Each row carries both measurements of a participant.
  4. 4. The differences are strongly skewed with outliers and n = 10. What do you run?

    The Wilcoxon signed-rank test is the non-parametric alternative for related samples.

Summary

  • Use the paired-samples t test for before/after or matched data on a scale variable.
  • Data: two columns, one row per case. Menu: Analyze > Compare Means > Paired-Samples T Test.
  • SPSS reports Variable 1 minus Variable 2; read the paired-differences table and CI.
  • Check the differences for normality; use Wilcoxon signed-rank when they are skewed.

Next: Chi-Square Test of Independence