Tutorials › Exam PA - Predictive Analytics › Small Multiples for Comparing Many Groups

Exam PA · Visualization and Anomaly Detection · Tutorial 160 of 966

Small Multiples for Comparing Many Groups

Learn to arrange comparable plots in panels with shared scales so group differences and unusual patterns are easier to assess.

Beginner 10 min read

What You'll Learn

  • Define small multiples and identify when they help compare groups.
  • Choose consistent axes, bins, and plot types across panels.
  • Use faceted plots in R to examine distributions and group-specific patterns.
  • Distinguish a group’s unusual observation from evidence of a data error.
  • Recognize how sample size and scale choices affect comparisons.

Why Use Small Multiples?

When a data set contains many groups, putting every group in one plot can make the display crowded. Overlapping density curves, bars, or symbols may hide important patterns. Making one separate plot for every group avoids overlap, but then the reader must repeatedly adjust to different axes and plotting conventions. Small multiples address both problems: they arrange several versions of the same plot in a grid, with one panel for each group.

For example, a hypothetical insurer might compare claim settlement times across several regions. A panel for each region can show whether the distributions have similar shapes, whether one region tends to have longer times, and whether a particular region contains an unusually large value. The panels are most useful when the plotted variable, plot type, and axes are comparable from one group to the next.

Definition: A small-multiples display is a set of related plots arranged in separate panels, where each panel shows the same kind of data summary for a different group. A fixed-scale display uses the same axis limits and measurement units in every panel. The panels differ in the group shown, not in the meaning of the visual scales.

Small multiples complement other grouped displays. An overlay can make broad differences easy to see when there are only a few groups, while separate panels are often clearer as the number of groups grows. The goal is not simply to produce many plots; it is to make comparison systematic and legible.

Designing Comparable Panels

A good display begins with a specific comparison question. Are the groups being compared on typical values, distribution shape, spread, or unusual observations? That choice guides the plot type. For numeric distributions, panels might contain histograms or dot plots. For paired numeric variables, each panel might contain a scatterplot. For categorical outcomes, a panel could show a bar chart. The same kind of plot should be used across groups so that differences in appearance reflect the data rather than a change in display method.

For comparisons of magnitude, use shared axis limits. If one panel covers 0 to 20 days and another covers 0 to 5 days, equal-looking gaps on the page represent different numbers of days. This can make a modest difference appear large, or a substantial one appear small. Shared limits make the plotted distances directly comparable. The next step is to choose suitable limits and label them clearly; the central principle here is that the limits must mean the same thing in every panel.

For histograms, use the same bin boundaries and bin widths across panels. Otherwise, a value can fall into different parts of the distribution depending on the group’s panel. Also decide what the vertical axis should represent. Counts communicate how many observations fall in a bin, so they are useful when group volumes matter and group sizes are comparable. Proportions or densities are often more suitable for comparing distribution shapes when group sizes differ, because raw counts partly reflect how many observations were collected. The choice depends on the question: a standardized vertical scale does not replace context about group size.

In R, a common approach is to map a group variable to panels with ggplot2’s facet_wrap or facet_grid. For instance, a histogram of settlement time can be faceted by region using facet_wrap(~ region, scales = "fixed"). The fixed setting keeps the scales shared. In base R, a multi-panel layout can be made with a layout function such as par(mfrow = c(2, 3)), followed by the same plotting command for each group. In either case, use consistent breaks, limits, labels, and plot settings.

  • Keep the visual encoding consistent. Use the same units, bins, symbols, and meaning for color in every panel.
  • Make group labels easy to find. Use clear panel titles and a sensible group order, such as geographic order or increasing group size.
  • Show group size when it matters. A panel based on a small number of observations can look unusually smooth or uneven by chance. Include sample sizes in labels or accompanying text when they inform interpretation.
  • Leave room for the data. Too many tiny panels can make values difficult to read. A display should reduce clutter without making individual observations or axis labels illegible.

Worked Example: Comparing Three Distributions

A hypothetical service team compares the number of days required to close requests in three offices. Each office has six observations. The recorded times are Office A: 4, 8, 12, 16, 18, 25; Office B: 5, 9, 11, 19, 21, 27; and Office C: 3, 7, 8, 9, 10, 12. The question is whether the distributions have similar shapes. Set up comparable histogram panels and interpret them.

Method. Use the same three bins in all panels: [0, 10), [10, 20), and [20, 30). These intervals include their lower endpoint but exclude their upper endpoint. Use counts on the vertical axis; this is reasonable for comparing these groups because each contains six observations.

Office A. The values 4 and 8 fall in [0, 10), giving a count of 2. The values 12, 16, and 18 fall in [10, 20), giving a count of 3. The value 25 falls in [20, 30), giving a count of 1. The bin counts are therefore (2, 3, 1), which sum to 6.

Office B. The values 5 and 9 fall in [0, 10), giving a count of 2. The values 11 and 19 fall in [10, 20), giving a count of 2. The values 21 and 27 fall in [20, 30), giving a count of 2. The counts are (2, 2, 2), which also sum to 6.

Office C. The values 3, 7, 8, and 9 fall in [0, 10), giving a count of 4. The values 10 and 12 fall in [10, 20), giving a count of 2. There are no observations in [20, 30), so the counts are (4, 2, 0), again summing to 6.

The shared bin boundaries let us compare corresponding ranges directly. Office A has its largest count in the middle bin, Office B is evenly distributed across the three bins, and Office C has no observations in the highest bin. These are differences in the observed distributions, not by themselves proof of a cause. Common mistake avoided: choosing a different bin width or starting point for one office can create apparent shape differences that are due to the display rather than a fair comparison.

Why Shared Scales Make Comparisons Fairer

A shared scale is useful because it gives every panel the same visual mapping from data values to positions on the page. Suppose the horizontal axis in each panel runs from \(a\) to \(b\), and the plotting region has width \(W\) pixels, starting at pixel position \(L\). A value \(x\) is placed at:

$$ \text{pixel position of } x = L + W\frac{x-a}{b-a}. $$

When \(a\), \(b\), \(L\), and \(W\) are the same across panels, the same data value appears at the same horizontal position in each panel. A difference of five units also occupies the same distance in every panel. If each panel instead uses its own limits, the denominator \(b-a\) changes; then the same difference in the data can occupy different visual distances.

This is why a shared scale supports a direct comparison of magnitude. It does not guarantee that the display answers every question: the selected range must still include the observations of interest, and group sizes still matter. But without a common mapping, visual comparisons of distance are not on equal terms.

Worked Example: Finding a Group-Specific Unusual Value

A hypothetical operations manager plots the number of days needed to review applications for three teams. The observations are Team A: 8, 9, 9, 10, 11; Team B: 8, 9, 10, 10, 11; Team C: 8, 9, 10, 11, 19. The manager wants to see whether a high review time is concentrated in one team. Use one dot-plot panel per team, with a shared horizontal scale from 0 to 20 days.

Method. Place each observed time as a dot in its team’s panel, stacking dots when values repeat. Compare the locations and spreads using the same horizontal scale. Each panel has five observations, so the count of plotted dots should be five.

For Team A, the ordered values are 8, 9, 9, 10, 11. Its minimum is 8, maximum is 11, and range is \(11 - 8 = 3\) days. Its median is 9, the third value in the ordered list.

For Team B, the ordered values are 8, 9, 10, 10, 11. Its minimum is 8, maximum is 11, and range is \(11 - 8 = 3\) days. Its median is 10.

For Team C, the ordered values are 8, 9, 10, 11, 19. Its minimum is 8, maximum is 19, and range is \(19 - 8 = 11\) days. Its median is 10. The value 19 is visually separated from the other four times in Team C, while the other teams’ observations range only from 8 to 11.

The panels therefore show a potentially unusual high value specific to Team C; they do not establish that 19 is erroneous. It could be a genuine slow review or a recording problem, so the observation should be checked in context before drawing a conclusion. Common mistake avoided: giving Team C a narrower horizontal scale would make the value 19 less visibly distant and would prevent a fair comparison of spread across teams.

Reading Panels Without Losing Context

Separate panels make group-specific patterns easier to see, but they can also encourage readers to treat each group as an unrelated data set. Keep the comparison question in view. A group may have a different center, more spread, a different distribution shape, or one unusual observation. Those are distinct findings. If the goal is to compare typical values, a plot should make location differences legible; if the goal is to detect a group-specific pattern, retain enough detail to see the observations that create it.

A further consideration is unequal group size. For count histograms, a panel with more observations can have taller bars simply because more data were collected. If the question concerns the fraction of each group in a bin, calculate proportions by dividing each bin count by that group’s total. For example, a count of 4 out of 8 is a proportion of \(4/8 = 0.5\), while a count of 4 out of 20 is \(4/20 = 0.2\). Those counts match, but the proportions do not. State which comparison the vertical axis supports.

Small multiples are aligned with the SOA Exam PA (Predictive Analytics) syllabus because they support careful visual exploration before modeling: compare like with like, retain group context, and investigate patterns rather than treating a plot as a verdict. In applied work, a useful display should help a reader identify what merits checking without implying more certainty than the data provide.

Common Mistakes

  • Changing the scale from panel to panel. Equal-looking distances then need not represent equal data differences. Use fixed limits when comparing magnitudes.
  • Changing histogram bins across groups. Use common boundaries and widths so corresponding bars summarize the same intervals.
  • Confusing counts with distribution shape. Taller count bars can reflect larger group size. Use proportions or densities when the question is about relative distribution, and report group sizes where useful.
  • Calling a visible extreme an error. A plot can flag a value for investigation; it cannot determine whether the value is plausible or incorrectly recorded.
  • Making panels too small. A dense grid may technically display every group but make individual observations and labels impossible to read. Reduce the number of panels per page or choose a more legible arrangement.
Key takeaway: Small multiples make many groups easier to compare by separating them into panels while keeping the plot type, units, and scale consistent. Interpret visible differences in light of group size and context; a visual anomaly is a reason to investigate, not a conclusion by itself.

Check Your Understanding

For each problem, decide what the panels should show and what conclusion the display supports.

  1. A hypothetical call center has four teams with 12, 12, 12, and 12 call durations. You want to compare distribution shape using histograms. State two settings that should be identical across panels. (Answer: Use the same bin boundaries and widths, and the same axis limits; with equal group sizes, counts can be compared directly.)
  2. A hypothetical portfolio review compares claim sizes for groups with 10, 25, and 40 claims. The question concerns the fraction of each group below a specified amount. Should the vertical axis show counts or proportions? (Answer: Proportions, because the group sizes differ and the question asks about fractions.)
  3. Two panels show the same variable, with observed values from 10 to 20 in each group. One panel uses a horizontal axis from 0 to 20 and the other from 10 to 20. What is the main comparison problem? (Answer: The scales differ, so equal visual distances do not represent equal data differences; use shared limits for a direct magnitude comparison.)
  4. A dot plot shows five inspection times for each of two hypothetical depots. Depot East has 6, 7, 8, 9, 10; Depot West has 6, 7, 8, 9, 18. Calculate each range and identify the group-specific pattern. (Answer: East range \(10 - 6 = 4\); West range \(18 - 6 = 12\). West has a high value separated from its other observations.)
  5. Three groups have bin counts (2, 2, 2), (4, 4, 4), and (1, 1, 1), with group sizes 6, 12, and 3. Calculate the proportions in the first bin and state the comparison. (Answer: \(2/6 = 0.3333\), \(4/12 = 0.3333\), and \(1/3 = 0.3333\); the first-bin proportions are equal even though the counts differ.)
Clinical Biostats