Tutorials › Introduction to Statistics › Graphing Paired Data and Difference Distributions

Paired and Matched Designs · Tutorial 757 of 996

Graphing Paired Data and Difference Distributions

Use connected measurements and within-pair difference plots to see patterns that separate group summaries may conceal.

Intermediate 10 min read

What You'll Learn

  • Draw and read a paired line plot by connecting measurements that belong to the same pair.
  • Construct a plot of within-pair differences using an explicitly stated sign convention.
  • Compare the direction and variability of paired changes with what separate group summaries show.
  • Recognize unusual pairs and understand what a plot can—and cannot—establish about them.
  • Choose a useful display for a small paired data set and describe its features in context.

Why Plot the Pairing?

When two measurements belong to the same person, matched units, or deliberately matched participants, their relationship is part of the data. A plot of each group separately can show the values in each group, but it cannot show which observations belong together. A paired line plot preserves those links; a plot of within-pair differences makes each linked comparison a single value.

These displays help answer descriptive questions: Do most pairs move in the same direction? How much do changes vary from pair to pair? Is one pair notably different from the rest? Such questions are not answered by looking only at the two group averages. In this tutorial, we focus on visualizing paired data, not on drawing inferential conclusions from the plots.

Definition: A paired line plot displays two measurements for each pair at their respective group or condition positions and connects the two measurements belonging to that pair. A within-pair difference is the difference between the two measurements in a pair, calculated using a stated order. A difference plot displays the resulting differences, usually as dots along a number line.

The sign convention must be stated because reversing the subtraction reverses the signs and the graph's directional interpretation. Unless an example specifies otherwise, we use \(d_i = \text{second measurement} - \text{first measurement}\) for pair \(i\). Thus, a positive \(d_i\) means the second measurement is larger, and a negative \(d_i\) means it is smaller. In a before-and-after example, we will label the order directly.

How to Read the Two Displays

For a paired line plot, put the first condition at one horizontal position and the second condition at another. Plot each pair's two values on a vertical scale measured in the outcome's units, then connect that pair's points. A line rising from the first position to the second represents an increase; a falling line represents a decrease; a horizontal line represents no change. The line's vertical displacement equals the second measurement minus the first.

$$ \text{vertical displacement for pair } i = y_{i,\text{second}} - y_{i,\text{first}} = d_i $$

This equality explains why a connected plot is useful: the direction and size of each line correspond to the direction and size of that pair's difference. The vertical axis shows the original measurements, while the line links show the comparisons. These are not lines intended to model a continuous relationship between the two conditions; the two horizontal positions represent conditions, not a continuous explanatory variable.

A difference plot puts each \(d_i\) on a number line, with zero marked as a reference. Values to the right of zero are positive, and values to the left are negative under the chosen convention. The plot makes the distribution of the pairwise changes easy to inspect: its direction, spread, clusters, gaps, and potentially unusual values. If values overlap, a dot plot can use slight vertical offsets so the number of observations at each value remains visible.

A difference plot does not show both original measurements for a pair. If their absolute levels matter—for example, whether a change occurred among measurements that were generally high or low—the paired line plot may be more informative. Using both displays can be helpful because they emphasize different features.

Worked Example: Before-and-After Measurements

Suppose six fictional volunteers have blood pressure measured before and after a change in a daily routine. The measurements below are hypothetical and are used only to illustrate the plots. Define \(d_i = \text{after} - \text{before}\), in mmHg.

VolunteerBefore (mmHg)After (mmHg)\(d_i\) (mmHg)
1142136-6
2158150-8
31351394
4167155-12
5149145-4
61541540

For volunteer 1, the difference is \(136 - 142 = -6\) mmHg, so that person's line slopes downward by 6 mmHg from before to after. For volunteer 3, \(139 - 135 = 4\) mmHg, so that line slopes upward by 4 mmHg. Volunteer 6 has a horizontal line because \(154 - 154 = 0\) mmHg.

The six differences are \(-6, -8, 4, -12, -4,\) and \(0\) mmHg. Five are negative or zero, and four are strictly negative; one is positive. A difference plot would show four dots left of zero, one dot at zero, and one dot right of zero. The paired line plot would also preserve the before and after levels, which range from 135 to 167 mmHg before and from 136 to 155 mmHg after.

For a descriptive reference, their mean difference is

$$ \bar{d} = \frac{-6 + (-8) + 4 + (-12) + (-4) + 0}{6} = \frac{-26}{6} \approx -4.333\text{ mmHg}. $$

That average summarizes the signed changes, but the plots show additional features: changes do not all have the same direction, one pair increased, and one showed no change. The negative average alone would not display those details. This description does not establish why the measurements changed.

What Separate Group Plots Can Hide

The pairing can change the pattern of differences even when the two groups' values—and therefore their separate plots—are unchanged. The following example uses four matched fictional units and scores in points.

Worked Example: Identical Group Values, Different Pairings

Suppose the first-condition values are \(10, 20, 30,\) and \(40\), and the second-condition values are \(13, 23, 33,\) and \(43\). Define each difference as second condition minus first condition. First, consider a pairing that matches the values in the listed order.

$$ (13-10,\ 23-20,\ 33-30,\ 43-40) = (3,\ 3,\ 3,\ 3)\text{ points}. $$

Every paired line rises by 3 points, and the difference plot has all four dots at \(3\). Now keep exactly the same values in both conditions, but pair the first-condition values with second-condition values \(43, 33, 23,\) and \(13\), respectively.

$$ (43-10,\ 33-20,\ 23-30,\ 13-40) = (33,\ 13,\ -7,\ -27)\text{ points}. $$

This time, two lines rise and two fall, and the differences range from \(-27\) to \(33\) points. In both arrangements, the first-condition values are \(10, 20, 30, 40\), and the second-condition values are \(13, 23, 33, 43\). So separate plots of the two conditions are identical across the arrangements. What changes is which observations are linked, and therefore the pattern and spread of the pairwise differences.

In either arrangement the mean difference is 3 points. For the second arrangement, for example, \((33 + 13 - 7 - 27)/4 = 12/4 = 3\) points. That same average can coexist with very different individual patterns. This is why a pair-aware display is useful even when a group summary is available.

Looking for Unusual Pairs and Variation

A plot can flag pairs that deserve closer inspection. A difference far from the rest may represent a genuinely unusual response, a special circumstance, or a recording or data-entry error. The graph alone cannot determine which explanation is correct. Check the underlying observations and relevant study records before deciding how to describe or handle an unusual pair.

The difference plot is often the clearest display for comparing the sizes of changes: it puts every change on one common scale. The paired line plot can help explain an unusual difference because it shows both measurements that produced it. For instance, a large difference might arise from a particularly high starting value, a particularly low ending value, or both.

Worked Example: A Difference Far From the Others

Suppose six fictional machines are tested under settings A and B, with completion time recorded in seconds. Let \(d_i = B - A\), so a negative difference means the machine took less time under setting B.

MachineSetting A (seconds)Setting B (seconds)\(d_i\) (seconds)
14239-3
24540-5
34441-3
44642-4
54328-15
64744-3

For machine 5, \(d_5 = 28 - 43 = -15\) seconds, whereas the other differences are \(-3, -5, -3, -4,\) and \(-3\) seconds. The paired line plot shows that all six lines slope downward, but machine 5's line drops much farther than the others. The difference plot shows five values between \(-5\) and \(-3\) seconds and one value at \(-15\) seconds.

The mean difference is

$$ \bar{d} = \frac{-3-5-3-4-15-3}{6} = \frac{-33}{6} = -5.5\text{ seconds}. $$

When the differences are ordered, they are \(-15, -5, -4, -3, -3, -3\). The median is the average of the third and fourth values:

$$ \frac{-4 + (-3)}{2} = -3.5\text{ seconds}. $$

The mean of \(-5.5\) seconds is more negative than the median of \(-3.5\) seconds because the \(-15\)-second difference pulls the mean downward. Both summaries can be correct, but the difference plot makes that unusual pair visible. It is a prompt to investigate machine 5's measurements and conditions, not by itself evidence of an error.

A Short Justification: Why the Links Matter

A separate plot records which values occur in each condition but not the pair identities. In the example with scores, the paired difference for unit \(i\) is \(B_i-A_i\). If the links are changed, the individual subtractions change even though the lists of \(A_i\) and \(B_i\) values stay fixed. The two possible difference lists above show this directly:

$$ (3,3,3,3) \quad\text{versus}\quad (33,13,-7,-27). $$

Thus, a plot that displays only the two separate groups cannot in general reconstruct the distribution of within-pair differences. The paired line plot retains the links; the difference plot displays their numerical consequences. This is not a technical detail of graph design: it is the information that distinguishes paired data from two unlinked groups.

Choosing and Describing a Display

For a small or moderate number of pairs, a paired line plot is a direct way to show individual trajectories between two conditions. A difference dot plot is usually a compact way to show the distribution of changes, especially when the values repeat or cluster. For a larger data set, a histogram or boxplot of the differences can summarize the distribution, although these displays show less about each specific pair.

Use readable labels, units, and a scale that includes all observations. On a difference plot, mark zero clearly and state the subtraction order in the axis label or caption—for example, “After minus before (mmHg).” Avoid describing a negative value as an increase when the convention is second minus first. If the order is reversed, state the reversed interpretation.

The sequence of plotted pairs should not suggest a meaningful ordering if none exists. If pair identity or time order matters, label or arrange pairs accordingly. Otherwise, the main message should come from the directions and magnitudes of the connections, and from the distribution of the differences—not from the arbitrary left-to-right order of the pairs.

Common Mistakes

  • Plotting two groups separately and assuming the pairing is still visible. Separate displays retain the group values but lose the links. Connect each pair or explicitly plot the within-pair differences.
  • Leaving the sign convention unstated. A difference of \(-5\) has no directional interpretation until the subtraction order is known. Label which condition is subtracted from which.
  • Calling every negative difference a decrease without checking the order. With \(d_i = B_i-A_i\), a negative value means B is lower than A. If the subtraction order is \(A_i-B_i\), its meaning reverses.
  • Treating a line as evidence of a continuous trend between conditions. The line connects two measurements from one pair; it is not a fitted model or a claim about values between the conditions.
  • Deleting a point just because it looks unusual. A plot identifies a value for review; verify the data and study context before making a decision about it.
  • Letting an average stand in for the whole difference distribution. The same mean can accompany consistent changes or a mixture of large positive and negative changes. Inspect the individual differences as well.
Key takeaway: A paired line plot shows both measurements and their link; a difference plot shows the signed change for each pair. State the subtraction order, use context and units, and inspect the full pattern rather than relying only on separate group summaries or one average.

Check Your Understanding

Use the stated subtraction order in each answer, and describe features of the display in context.

  1. For a paired line plot with condition B on the right and condition A on the left, what does a line sloping upward from A to B indicate?
  2. A before-and-after study defines \(d_i = \text{after} - \text{before}\). What does a difference of \(-7\) units mean?
  3. Two data sets have the same values in each of two conditions, but the pairings differ. Explain why their difference plots could look different.
  4. A difference plot has five values near zero and one far to the left. Name one conclusion the plot supports and one conclusion it does not establish by itself.
  5. What information is retained in a paired line plot that is absent from separate plots of the two conditions?