Section 11.7

Paired design

Definition

A paired design is a plan for comparing two conditions in which every measurement under one condition has exactly one partner under the other, and the two partners share the same unit or the same circumstances, such as the same board or the same input. The analysis subtracts within each pair and works with the differences. Any amount that the shared unit or circumstances add equally to both partners drops out of the difference. An unpaired design compares two separate groups of measurements that have no such one-to-one link.

The idea

An old and a new software version are compared on two boards. Board A answers in about 10 milliseconds (ms) and board B in about 100 ms. The new version adds 2 ms on either board. Across boards, the 90 ms gap between them drowns the 2 ms effect. On one board at a time, the speed of the board is in both numbers and subtracts out: 12−10=212 - 10 = 2 ms on A and 102−100=2102 - 100 = 2 ms on B.

Each unit serves as its own reference. A bathroom scale that reads 3 kg too high still shows a change of weight correctly, because the 3 kg error is in both readings. The picture stops being accurate in one respect: the error of the scale is constant, whereas a board measured at two moments has changed a little in between. Whatever differs between the two measurements of a pair, apart from the condition, stays in the difference.

How it works

  1. Fix the pairing rule before looking at any outcome: same device, same input, or same time slot.

  2. Measure both conditions in every pair. Let chance decide which condition comes first in each pair; this is randomization §11.8. Otherwise the effect of coming second is mixed with the effect of the condition, which is called confounding §11.10.

  3. Store with every measurement the identifier of its pair.

  4. For each pair ii compute the difference di=ti−bid_i = t_i - b_i. Here bib_i is the measurement under the reference condition, called the baseline, and tit_i is the measurement under the changed condition, called the treatment.

  5. Analyze the differences as one sample. Their mean is the estimated effect. Their standard deviation §11.14, the typical distance of a difference from that mean, divided by the square root of the number of pairs is the standard error §11.15, which measures how uncertain the estimated effect is. The paired tt-test, the usual test of whether such a mean difference exceeds chance, uses this mean and this standard error.

Step 5 treats the pairs as independent of each other, so the number that counts is the number of pairs. Fifty pairs taken on one board share that board: as evidence about boards in general they are not fifty independent pairs. A method that estimates uncertainty by drawing new data sets at random from the recorded data, such as the bootstrap §11.19, has to draw whole pairs and never single measurements. A paired design is the simplest case of blocking §11.9, the practice of comparing conditions inside groups of similar units: every pair is a block of two.

Worked example

Four boards are measured under the baseline and under the treatment. Response times §9.32 are in ms.

Board Baseline Treatment Difference
1 10 12 2
2 50 53 3
3 100 101 1
4 200 202 2

Paired analysis. The mean difference is (2+3+1+2)/4=8/4=2(2 + 3 + 1 + 2)/4 = 8/4 = 2 ms. The differences deviate from 2 by 0, 1, −1-1 and 0, and the squares of these deviations add up to 2. Dividing by 4−1=34 - 1 = 3, the usual divisor for the variance of a sample, gives 2/3≈0.667 ms22/3 \approx 0.667 \text{ ms}^2. The standard deviation is 2/3≈0.816\sqrt{2/3} \approx 0.816 ms, and the standard error is 0.816/4=0.4080.816/\sqrt{4} = 0.408 ms. The estimated effect of 2 ms lies about 5 standard errors away from zero.

The same numbers analyzed as two unrelated groups. The baseline mean is 360/4=90360/4 = 90 ms and the treatment mean is 368/4=92368/4 = 92 ms, so the difference of the means is again 2 ms. But the values differ widely from board to board: the variance of the baseline values, computed in the same way, is 20,200/3≈6733.3 ms220{,}200/3 \approx 6733.3 \text{ ms}^2, and that of the treatment values is 20,102/3≈6700.7 ms220{,}102/3 \approx 6700.7 \text{ ms}^2. The formula for two independent groups gives the standard error 6733.34+6700.74=3358.5≈58 ms.\sqrt{\frac{6733.3}{4} + \frac{6700.7}{4}} = \sqrt{3358.5} \approx 58 \text{ ms}. The 2 ms effect disappears behind a standard error of 58 ms. That is about 140 times the paired standard error, because only the paired analysis removes the differences between boards.

Stated precisely

Let BB and TT be the baseline and treatment measurements of one pair, and let D=T−BD = T - B. Write Var\mathrm{Var} for variance, the average squared distance of a quantity from its mean, and Cov\mathrm{Cov} for covariance §15.44, the measure of how two quantities vary together. Then Var(D)=Var(T)+Var(B)−2Cov(T,B).\mathrm{Var}(D) = \mathrm{Var}(T) + \mathrm{Var}(B) - 2\,\mathrm{Cov}(T, B). With nn independent pairs, the mean of the differences has variance Var(D)/n\mathrm{Var}(D)/n. Two independent groups of nn measurements give a difference of means with variance (Var(T)+Var(B))/n(\mathrm{Var}(T) + \mathrm{Var}(B))/n. Pairing therefore changes the variance by −2Cov(T,B)/n-2\,\mathrm{Cov}(T, B)/n. With variances of 4 ms24 \text{ ms}^2 and a covariance of 3 ms23 \text{ ms}^2, Var(D)=4+4−2×3=2 ms2\mathrm{Var}(D) = 4 + 4 - 2 \times 3 = 2 \text{ ms}^2, against 4+4=8 ms24 + 4 = 8 \text{ ms}^2 for independent groups.

The covariance comes from what the partners share. Write B=u+eBB = u + e_B and T=u+τ+eTT = u + \tau + e_T, where uu is the level of the unit, τ\tau (tau) is the effect of the treatment, and eBe_B and eTe_T are the separate noise of the two measurements. Then D=τ+eT−eBD = \tau + e_T - e_B: the unit level uu has dropped out. This requires that uu enters both measurements in the same additive way, and that nothing else differs systematically between the two measurements of a pair.

When every pair is complete, the mean of the differences always equals the difference of the two condition means. Pairing changes the uncertainty of a mean effect, not its estimate.

Limits and common mistakes

Pairing has to be designed in. Sorting two unrelated lists and matching similar values afterwards produces differences that mean nothing.

The first measurement can change the unit, for example by warming it up, before the second is taken. Subtraction does not remove such carry-over effects. Randomizing the order cancels a carry-over effect only on average over the possible orders, and only when the effect is the same whichever condition comes first. Suppose each condition takes 10 ms when it is measured first, running the treatment first adds 10 ms to the measurement after it, and running the baseline first adds nothing. Treatment first gives D=10−20=−10D = 10 - 20 = -10 ms, and baseline first gives D=10−10=0D = 10 - 10 = 0 ms. Even an exactly balanced set of orders then averages (−10+0)/2=−5(-10 + 0)/2 = -5 ms, although the treatment has no effect. A pause lets a passing effect such as heat fade, but it does not undo a lasting change such as data left in a cache. Reset such state between the two measurements, or show that the pause is long enough for the effect to disappear.

A pair with a missing partner gives no difference. Decide before the experiment what happens to incomplete pairs: dropping them restricts the result to the pairs in which both runs succeeded.

Pairing is not always the better choice. It leaves nn differences to estimate the noise from, where two separate groups give 2n2n values. When the covariance of the partners is zero, nothing drops out of the difference, and pairing brings only this cost. When the covariance is negative, a paired difference varies more than the difference between two independent measurements.

A difference and a ratio are different targets. A change from 10 ms to 12 ms is +2+2 ms and +20%+20\%, while a change from 100 ms to 102 ms is +2+2 ms and +2%+2\%.

Summaries other than the mean depend on the order of operations. With baseline values 1, 5 and 9 ms and treatment values 4, 6 and 20 ms, the differences 3, 1 and 11 ms have the median §11.13 (the middle value) 3 ms, but the two medians, 5 ms and 6 ms, differ by 1 ms.

Questions answered

Why analyze paired differences rather than unrelated group summaries?

Because the two measurements of a pair are taken on the same unit under the two conditions, and subtracting one from the other removes whatever that unit adds equally to both, which is usually the largest source of variation in the data.

A valid paired analysis also needs a randomized order inside each pair, state left by the first measurement reset or faded before the second, and every later step has to keep the two measurements of a pair together.

Related entries: Blocking (§11.9), Confounding (§11.10), Bootstrap (§11.19), Ratio of aggregates versus aggregate of ratios (§11.40), Experimental unit (§11.3), Pseudoreplication (§11.6), Randomization (§11.8), Correlation and covariance (§15.44).