Why Display Outcomes by Category?
When a predictor divides observations into categories and the response is quantitative, a useful question is how the observed outcomes are distributed in each category. For example, a clinic might compare waiting times across appointment types, or a school might compare quiz scores across class formats. A display should make the groups easy to compare without suggesting that a difference between groups is necessarily caused by the category.
A strip plot shows the individual outcome values within each category. A boxplot gives a compact summary of each group’s distribution. The two displays answer different visual questions: a strip plot emphasizes the observations themselves, while a boxplot emphasizes a few landmarks in the distribution. Either can be useful, and neither shows everything.
Reading a Strip Plot
Place the categories along one axis and the quantitative outcome, with its units, along the other. Each point represents one observation. In a vertical strip plot, for instance, appointment type might be on the horizontal axis and waiting time in minutes on the vertical axis. The points for one category form a vertical strip; a separate strip represents each other category.
If several observations have the same outcome, their points occupy the same location and may cover one another. A small horizontal offset, often called jitter, can reveal such overlaps. The offset is only a device for separating marks: it does not alter the measured outcome, and the horizontal position within a category has no quantitative meaning. The outcome’s scale should remain honest and labeled in units.
Strip plots make sample size, ties, gaps, clusters, and individual unusual values visible. They can become crowded when groups contain many observations. In that case, points may overlap heavily, making it difficult to tell how many observations lie in dense regions. Jitter can help reveal ties, but excessive jitter can make the plot look more spread out than the data really are.
Worked Example: Plotting Waiting Times by Appointment Type
Suppose, in a hypothetical clinic, six patients in each of two appointment categories have these waiting times. The numbers are minutes, and each patient contributes one observation.
| Category | Waiting times (minutes) |
|---|---|
| Routine | 8, 10, 10, 12, 14, 18 |
| Urgent | 6, 9, 11, 11, 15, 24 |
For a strip plot, put Routine and Urgent at separate horizontal positions and use a vertical axis labeled “Waiting time (minutes).” Plot the Routine observations at heights 8, 10, 10, 12, 14, and 18, and the Urgent observations at 6, 9, 11, 11, 15, and 24. Each category has six points. The two Routine points at 10 minutes coincide, as do the two Urgent points at 11 minutes. A small horizontal offset within each category can make each pair visible; the points must still align with the correct waiting-time value.
The plot displays all 12 observations and shows that both groups include repeated values. It also makes the 24-minute Urgent wait visible as a high value relative to the other Urgent waits. The plot alone does not explain why that wait was long, nor does it establish that appointment type caused any difference.
What a Boxplot Shows
A boxplot condenses a group’s quantitative values. The median is the middle value after sorting the observations; for an even number of observations, it is the average of the two middle values. The first quartile \(Q_1\) and third quartile \(Q_3\) mark the lower and upper quarters of the distribution. The interval from \(Q_1\) to \(Q_3\) is the interquartile range, or IQR:
Quartile calculation conventions can differ, particularly for small samples. For consistency in the calculations below, use the median-of-halves convention: sort the data, divide it into lower and upper halves, and take the median of each half for \(Q_1\) and \(Q_3\). When the number of observations is odd, leave the overall median out of both halves. Software may use another documented convention, so exact quartile values can differ slightly across displays.
A common boxplot rule defines the lower and upper fences as \(Q_1-1.5(\mathrm{IQR})\) and \(Q_3+1.5(\mathrm{IQR})\). Whiskers extend to the smallest and largest observed values that lie within those fences. Values beyond a fence are shown individually, often as dots. The fence is a rule for flagging values for display, not a boundary on valid data, a significance test, or proof that an observation is erroneous.
Worked Example: Calculating a Boxplot for One Group
Suppose a hypothetical group of eight trainees completes a task in these numbers of minutes: 12, 14, 15, 16, 18, 19, 21, and 35. Use the median-of-halves convention and the 1.5-IQR rule to determine the box, whiskers, and any separately plotted values.
The sorted values are already listed. The median is the average of the fourth and fifth values:
The lower half is 12, 14, 15, 16, whose median is \(Q_1=(14+15)/2=14.5\) minutes. The upper half is 18, 19, 21, 35, whose median is \(Q_3=(19+21)/2=20\) minutes. Therefore,
The lower fence is \(14.5-1.5(5.5)=6.25\) minutes, and the upper fence is \(20+1.5(5.5)=28.25\) minutes. The observations 12, 14, 15, 16, 18, 19, and 21 are within the fences; 35 is above the upper fence. The box runs from 14.5 to 20 minutes, with its median line at 17. The lower whisker reaches 12 and the upper whisker reaches 21, the most extreme observed values within the fences. Plot 35 as a separate point. It is flagged by the rule, but the calculation does not establish that it is an error or explain why it occurred.
Putting the Displays Together
A strip plot and a boxplot can be used side by side for the same groups. The strip plot helps a reader inspect individual values; the boxplot makes it easier to compare group medians and the middle halves of the distributions, especially when there are many observations. A boxplot can also draw attention to values beyond the 1.5-IQR fences. However, it hides details such as ties and gaps unless those happen to be apparent from the summarized landmarks.
When making a comparison, check the sample sizes as well as the plotted shapes. A box and whiskers do not directly state how many observations produced them. A strip plot shows the count if its points are not obscured. Neither display, by itself, provides an uncertainty assessment or a formal test of a group difference.
Worked Example: What a Boxplot Can Conceal
Consider two hypothetical groups with six outcomes each, measured in the same units:
| Group | Sorted outcomes |
|---|---|
| A | 2, 2, 2, 8, 8, 8 |
| B | 2, 3, 4, 5, 6, 7 |
For Group A, the median is \((2+8)/2=5\), \(Q_1=2\), and \(Q_3=8\). For Group B, the median is \((4+5)/2=4.5\), \(Q_1=3\), and \(Q_3=6\). Both groups have six observations. Their IQRs are \(8-2=6\) for A and \(6-3=3\) for B.
With the 1.5-IQR rule, Group A’s fences are \(2-1.5(6)=-7\) and \(8+1.5(6)=17\), so all six values lie within them. Group B’s fences are \(3-1.5(3)=-1.5\) and \(6+1.5(3)=10.5\), so all six values also lie within them. The whiskers reach each group’s minimum and maximum. A boxplot summarizes the central landmarks and spread, but it does not show that A’s values occur in two piles, at 2 and 8, while B’s values fill the intervening range. A strip plot reveals that important difference.
This example also illustrates why neither display should be interpreted alone. The boxplot gives a compact comparison; the strip plot shows the individual pattern that the boxplot omits. For small groups, plotting the points may be particularly informative.
Common Mistakes and Practical Choices
- Treating a flagged point as an error. A value beyond a 1.5-IQR fence is unusual by that display rule, not automatically wrong. Check the data and context before deciding how to handle it.
- Assuming a whisker reaches a fence. The whisker ends at an observed value within the fence. It may stop short of the fence when no observation lies near it.
- Reading jitter as added variation. Horizontal offsets only separate overlapping marks within a category. They have no substantive meaning; the outcome values remain unchanged.
- Assuming a boxplot shows every feature. Quartiles and whiskers cannot reveal all ties, clusters, gaps, or the shape of the full distribution. Inspect individual points when those details matter.
- Inferring causation from group differences. A display describes observed outcomes by category. It does not by itself show that category membership caused the pattern.
Choose a strip plot when the number of observations is manageable and individual values, ties, or clusters are important. Choose a boxplot when a compact comparison of distribution landmarks is useful, particularly across several groups. If space and readability permit, showing both can combine the strengths of each. Label categories and outcome units clearly, and state any quartile or whisker convention that affects interpretation.
Check Your Understanding
Use the definitions and plotting rules in this tutorial to answer the following.
- In a strip plot of exam score by course format, what does each point represent, and which coordinate has no quantitative meaning if jitter is used?
- A group has \(Q_1=10\) and \(Q_3=18\). Calculate its IQR and its two 1.5-IQR fences.
- Why might a whisker stop before its corresponding fence?
- What feature of a distribution can a strip plot show clearly that a boxplot may conceal?
- Does a point beyond a 1.5-IQR fence prove that the recorded observation is an error? Explain.