Definition
A paired difference is one measurement minus its partner, where two measurements are partners because they share the thing measured, such as the same board, or the same circumstances, such as the same boot or the same input, and differ only in the condition being compared. A difference of medians summarizes each condition separately by its median §11.13, the middle value of its sorted measurements, and subtracts one median from the other. The median of the paired differences and the difference of medians can disagree in size and even in sign.
Where it fits
Main entry: Paired design (§11.7).
The paired design entry explains why measurements are taken in pairs: whatever the shared unit adds equally to both partners drops out when one partner is subtracted from the other. A figure or table keeps that benefit only if it keeps the pairs. Number the pairs . Let be the baseline measurement of pair , its treatment measurement, meaning the measurement under the condition being tested, and its paired difference. The median of describes the typical change within one unit. The difference compares the middles of two groups and ignores which values belong together. For means, subtracting first and summarizing first give the same result, because the mean of the differences always equals the difference of the means. For medians they need not.
Each of three boots gives one baseline and one treatment measurement: milliseconds and milliseconds, in boot order. The paired differences are , and milliseconds. Sorted, they are , so their median is 1 millisecond: in a typical boot the treatment took 1 millisecond longer. The median of is 11 milliseconds and the median of is 20 milliseconds, so the difference of medians is milliseconds, which suggests that the treatment is faster. The means agree with each other: the mean of the differences is milliseconds, and the difference of the means is milliseconds as well.
A pair is a fact about how the experiment was run, recorded by an identifier such as a boot number, not by the position of a row in a file. Sorting each column separately and subtracting the -th smallest baseline value from the -th smallest treatment value, for each , compares the two distributions quantile §11.16 by quantile: a valid description of how the two sets of values differ, but not a set of paired differences. Pairing also reduces noise. When units differ a lot, the two values of a pair rise and fall together, and subtracting them removes the part that comes from the unit.
Limits and common mistakes
A pair with a missing partner cannot be differenced. Report how many pairs were dropped, and do not fill the gap with a value from another unit.
Pairing does not remove order effects. If the baseline always runs first within each boot, any warm-up §11.27 or drift within the boot enters every difference. Alternate or randomize the order within each pair.
Measurements from independent groups have no partners. Inventing pairs, for example by row number, produces differences that belong to no unit; compare such groups with a method for unpaired data.
Sorting the paired differences to find their median is correct. Sorting the two columns before subtracting is the mistake.
Fix the matching rule, such as the boot number, before looking at the results, so that the choice of rule cannot be steered by them.
Questions answered
Why not subtract arbitrary corresponding points?
Arbitrary corresponding points must not be subtracted because a difference measures the effect of the tested condition only when its two values come from the same unit, such as the same boot or the same board, so that everything else about that unit cancels. Two values that merely sit in the same row of two files, or at the same rank after sorting, share nothing, and their difference mixes the effect of the condition with the difference between two unrelated units.
Take baseline values of 1, 10 and 20 milliseconds and treatment values of 2, 11 and 21 milliseconds, recorded in the same boot order. Every paired difference is 1 millisecond: the treatment adds 1 millisecond. If the treatment file lists the same values in the order 21, 2 and 11, row-by-row subtraction gives , and milliseconds. Sorted, these are , with median milliseconds: an apparent 8-millisecond improvement that never happened. Match measurements by a recorded identifier, such as the boot number, chosen before the results are seen.
Related entries: Median (§11.13), Correlation and covariance (§15.44), Blocking (§11.9), Figure 7 right: paired latency-gap scatter and identity line (§18.2.9), Randomization (§11.8), Quantile and percentile (§11.16).