Course contentsShow
← Data Science
Lesson 371 of 2,14510. Hypothesis Tests for MeansFree lesson

Calculating Paired Differences

Compute the difference for each pair and understand the direction and sign conventions.

Calculating Paired Differences

You'll learn how to compute the actual difference values for each pair and the conventions that govern their signs.

The Core Idea

In a paired t-test, each subject or unit provides two measurements—before and after, left and right, method A and method B. Rather than comparing two groups, you're comparing two measurements on the same unit. To perform the test, you first calculate the difference for each pair: subtract one measurement from the other.

The key question is: which measurement do you subtract from which?

Direction and Sign Conventions

The order matters because it determines the sign of your differences:

  • Difference = After − Before (or New − Old, Treatment − Control)
  • If "After" is larger, the difference is positive
  • If "Before" is larger, the difference is negative

This choice affects interpretation but not the validity of your test—just be consistent and state your convention clearly.

Example

Suppose you measure blood pressure before and after medication for three patients:

PatientBeforeAfterDifference (After − Before)
1140130−10
2150145−5
3135138+3

Negative differences suggest blood pressure decreased. If you had computed Before − After instead, the signs would flip, but your conclusion (about whether there's a real change) remains the same.

Key Takeaway: Calculate the difference for each pair by subtracting one measurement from the other in a consistent direction; the sign of the differences tells you whether values increased or decreased, and this becomes your single dataset for the paired t-test.