From a Matched Design to a Conclusion
A paired analysis is only as clear as its pairing. Before calculating a mean or a test statistic, identify which two measurements belong together and decide what a positive difference will mean. Those choices determine the quantity being analyzed and the direction of the conclusion.
This tutorial follows a hypothetical study of plant growth. Researchers form pairs of similar plots, randomly assign one plot in each pair to receive a fertilizer and the other to receive no fertilizer, and measure plant height after four weeks. The analysis focuses on the difference in height within each pair, not on treating the two sets of plot measurements as unrelated samples.
The subtraction order is a substantive choice, not a cosmetic one. For the plant study, define \(d_i=\text{fertilized height}-\text{unfertilized height}\). Then a positive difference means the fertilized plot in that pair had taller plants. Reversing the order would reverse every sign and the direction of the interpretation, while leaving the strength of the evidence unchanged if the hypotheses were reversed as well.
Worked Example: Identify the Pairing and Code Differences
Worked Example: Identify the Pairing and Code Differences
Suppose eight pairs of similar plots are observed. Within each pair, one plot is randomly assigned fertilizer. Heights after four weeks are recorded in centimeters. The hypothetical data are:
| Pair | Unfertilized height (cm) | Fertilized height (cm) | \(d=\) fertilized − unfertilized (cm) |
|---|---|---|---|
| 1 | 18 | 20 | 2 |
| 2 | 20 | 23 | 3 |
| 3 | 21 | 25 | 4 |
| 4 | 22 | 26 | 4 |
| 5 | 23 | 28 | 5 |
| 6 | 25 | 31 | 6 |
| 7 | 19 | 22 | 3 |
| 8 | 24 | 29 | 5 |
The observational units for the treatment comparison are the eight matched pairs of plots. The pairing key is the pair number: plots with the same number were deliberately matched before the treatment comparison. Each difference is calculated in the stated order; for example, pair 1 gives \(20-18=2\) cm and pair 6 gives \(31-25=6\) cm. Thus, all eight observed differences favor greater height in the fertilized plot.
The difference data, in centimeters, are \(2,3,4,4,5,6,3,5\). This compact list—not the two separate height columns—is the data set for the paired t analysis. Pairing retains the within-pair comparison and accounts for shared features of plots in each pair.
Check the Differences Before Inference
A paired t procedure relies on the distribution of the differences, not on the separate distributions of the two measurements. The diagnostic display should therefore be a dotplot or another suitable graph of the \(d_i\)'s. With only a few pairs, a graph is especially useful for noticing a striking outlier, strong skew, or a data-entry error that summary statistics might conceal.
For the plant data, the sorted differences are \(2,3,3,4,4,5,5,6\) cm. They form a compact, roughly balanced pattern with no isolated value or severe skew apparent. With \(n=8\), the sample is small, so this visual check matters: a paired t procedure is not justified merely because the original measurements are quantitative. The distribution of differences in the population should be approximately normal, with no severe outliers in the observed differences.
The design also matters. A paired t procedure assumes the pairs are independent of one another; dependence between the two observations within a pair is expected and is the reason for pairing. If the pairs were randomly sampled, that supports generalizing to the population from which they were sampled. In this hypothetical study, random assignment of fertilizer within each pair supports a causal comparison, provided the treatment is applied as assigned and one plot's treatment does not affect another plot's outcome. Random assignment and random sampling serve different purposes: the former supports causal interpretation, while the latter supports population generalization.
Worked Example: Paired t Inference for Mean Height Difference
Worked Example: Paired t Inference for Mean Height Difference
Use the eight plant-height differences to estimate and test whether fertilizer increases mean height. The target parameter is \(\mu_d\), the population mean of fertilized-minus-unfertilized height differences for the population represented by the matched plots. For a two-sided test of whether the mean difference is nonzero, use \(H_0:\mu_d=0\) and \(H_a:\mu_d\ne 0\). The paired t procedure is appropriate under the independence and difference-distribution conditions discussed above.
First calculate the mean difference. The sum is \(2+3+4+4+5+6+3+5=32\), so:
To calculate the sample standard deviation, the differences from their mean are \(-2,-1,0,0,1,2,-1,1\) cm. Their squared deviations sum to \(4+1+0+0+1+4+1+1=12\text{ cm}^2\), giving:
The standard error describes the estimated standard deviation of the sample mean difference over repeated samples of independent pairs. The paired t statistic and degrees of freedom are:
For a two-sided test with 7 degrees of freedom, this statistic gives \(p<0.001\). If \(H_0\) were true and the model conditions held, results at least this far from zero in either direction would be very unusual. The data provide strong evidence that the population mean paired difference is not zero. Since the estimated difference is positive, the observed direction favors greater mean height with fertilizer.
For context, a 95% confidence interval uses \(t^*=2.3646\) for 7 degrees of freedom. Using the unrounded standard error gives a margin of error of about \(2.3646(0.462910)=1.0946\) cm:
The interval estimates that the population mean increase in plant height is between about 2.905 and 5.095 cm. In repeated sampling under the model conditions, 95% of intervals constructed this way would cover the population mean difference. The interval does not describe the range of individual plot differences: it quantifies uncertainty about the mean.
Why the Standard Error Has This Form
The paired procedure uses the usual one-sample t standard error because it works with one value per pair: the difference. A short justification shows why the sample size in the formula is the number of pairs.
The sample mean difference is \(\bar{x}_d=(d_1+\cdots+d_n)/n\), the average of the \(n\) independent pair-level values.
If the population differences have variance \(\sigma_d^2\) and the pairs are independent, then the variance of their average is \(\sigma_d^2/n\). Its standard deviation is therefore \(\sigma_d/\sqrt{n}\).
Because \(\sigma_d\) is unknown, estimate it with the sample standard deviation \(s_d\). This gives \(SE=s_d/\sqrt{n}\); standardizing by this estimate uses a t distribution with \(n-1\) degrees of freedom when the population differences are normal.
This reasoning also explains why the two measurements in a pair should not be treated as independent observations in a two-sample analysis. The random units for the paired calculation are the independent pairs, and each pair contributes one difference.
Worked Example: Reversing the Difference Order
Worked Example: Reversing the Difference Order
Suppose six hypothetical devices each run the same task under two software versions. Their processing times, in seconds, are 52 and 49, 48 and 46, 55 and 50, 50 and 48, 60 and 57, and 47 and 45, respectively. Define \(d=\text{Version A time}-\text{Version B time}\). The six differences are \(3,2,5,2,3,2\) seconds, so positive values indicate Version B takes less time.
The mean is \(\bar{x}_d=(3+2+5+2+3+2)/6=17/6=2.833\) seconds. The sum of squared deviations from the mean is \((3-17/6)^2+3(2-17/6)^2+2(5-17/6)^2=41/6\) seconds squared. Thus:
Testing \(H_0:\mu_d=0\) against \(H_a:\mu_d\ne0\) gives:
The two-sided p-value is less than 0.01, providing evidence of a nonzero mean time difference under the paired t conditions. If the subtraction order were reversed to Version B minus Version A, every difference, the mean, and the t statistic would change sign; the two-sided p-value would be unchanged. The contextual interpretation must follow the chosen order: with the definition above, a positive mean means Version B is faster on average.
Common Mistake and Practical Interpretation
A common mistake is to subtract in one direction for some pairs and the reverse direction for others, or to say merely that a positive difference is “better” without defining the order. Either error makes the mean difference meaningless or reverses its interpretation. State the subtraction order first, calculate every pair consistently, and attach units to the estimate and interval.
Another important distinction is between statistical evidence and practical importance. The plant study's interval is entirely above zero, which supports a positive average difference under its assumptions. Whether an estimated increase of a few centimeters matters for a particular agricultural decision depends on the context; a small p-value alone does not answer that question. In addition, a paired design controls for differences within matched plots, but it does not automatically remove bias from poor matching, flawed measurement, or a lack of representative sampling.
Check Your Understanding
Use these questions to check whether each step of the analysis is clear.
- In the plant study, what does the pair number identify, and why is the difference—not either height column alone—the input to the paired t procedure?
- If differences are defined as unfertilized minus fertilized height, what happens to their signs and mean? What happens to a two-sided p-value?
- Why should the difference plot, rather than separate plots of the two measurement columns, be checked for outliers and skew for paired t inference?
- State the plant study's 95% confidence interval in context, including its units. What population quantity does it estimate?
- How do random assignment and random sampling support different parts of a study's conclusion?