Tutorials › Multiple Imputation by Chained Equations (MICE) › Faceting Trace Plots Across Imputed Variables

Convergence and Diagnostics Against Observed Data · Tutorial 210 of 497

Faceting Trace Plots Across Imputed Variables

Build readable faceted trace displays and interpret what their shared or separate scales reveal about variable-specific chain behavior.

Advanced 11 min read

What You'll Learn

  • Define the chain-level summaries and iteration indices used in a faceted MICE trace display
  • Decide when shared y-scales support valid cross-variable comparisons
  • Use free y-scales to inspect within-variable behavior without hiding scale differences
  • Organize chains consistently across panels to locate variable-specific instability
  • Recognize visual artifacts and limits of faceted trace plots

Why Facet Trace Plots?

A trace plot displays a summary calculated at successive iterations of a MICE chain. When several variables are imputed, plotting every summary and chain in one panel can produce a tangle: lines overlap, units differ, and a change in one variable can be hard to locate. Faceting separates the variables into panels while retaining a common iteration axis. This makes it easier to ask a focused diagnostic question: does any particular variable show behavior that differs from the others or from its own expected pattern?

Faceting is an arrangement of the display, not a new convergence test. The interpretation still depends on what each chain summary represents, how the chains were run, and whether the summaries are comparable. A trace that looks stable does not prove convergence, and a visual comparison across panels is meaningful only when the scale choices and summary definitions are made explicit.

Definition: Let \(S_{jmt}\) denote a chain-level summary for imputed variable \(j\), chain \(m\), and iteration \(t\). A faceted trace plot assigns each variable \(j\) its own panel, places iteration \(t\) on the horizontal axis, and plots \(S_{jmt}\) against iteration with chain \(m\) identified consistently, such as by color or line type. The summary might be an imputed mean, a dispersion summary, or a selected quantile; the same definition must be used for a given variable across chains and iterations.

A useful display keeps the iteration range aligned across panels and uses a consistent visual identity for each chain. For example, chain 1 should have the same color in every panel. Otherwise, the reader may incorrectly compare different chains from panel to panel. When burn-in has been excluded, the plotted iteration range should be stated or visible; panels should not silently use different portions of the run.

The earlier material on forming chain summaries and overlaying chains establishes what the plotted sequences represent and how chains can be compared within a variable. Faceting adds a layout that makes those comparisons manageable across variables. It does not make unlike summaries comparable: an imputed mean in one panel and a quantile in another have different meanings even if both are drawn as lines.

Choosing the Scale Across Panels

A shared y-scale gives all panels the same vertical range and unit. It is most useful when the plotted summaries use the same measurement scale and have ranges that can be read on one axis. Then a given vertical distance represents the same numerical change in each panel. By contrast, free y-scales let each panel use its own range. This can reveal small within-variable fluctuations when variables have very different magnitudes, but the same apparent line height can then represent very different numerical changes.

For instance, a one-unit change in a laboratory concentration measured in mg/L and a one-unit change in age measured in years are both numerical changes, but they are not interchangeable quantities. A shared numerical scale may be technically drawable, yet it may not support a scientifically useful comparison. Likewise, if one variable’s range is far larger than another’s, a shared scale can compress the smaller-range trace until its behavior is nearly invisible.

Scale choiceUseful whenInterpretation to preserve
Shared y-scalePanels use compatible units and a common numerical range is readableVertical distances are directly comparable across panels
Free y-scale by panelVariables have different magnitudes or units, or small within-panel changes need to be visibleJudge trace behavior within each panel; do not compare apparent line heights across panels
Transformed scaleA justified transformation makes a particular scale more interpretableState the transformation and interpret changes on that transformed scale

Worked Example: A Shared Scale for Compatible Summaries

Suppose two continuous variables, height in cm and weight in kg, are summarized by their imputed means at each iteration in two hypothetical chains. Over a selected iteration range, the plotted heights are 168.0–170.0 cm and the plotted weights are 68.0–72.0 kg. The numerical ranges overlap, but the units differ.

A shared numerical axis from 65 to 175 would leave the weight traces compressed near the bottom and make their changes difficult to see. The range widths are \(170.0-168.0=2.0\) cm for height and \(72.0-68.0=4.0\) kg for weight. A free scale could show both traces clearly, but a visible vertical movement of half a panel would represent about 1.0 cm in the height panel and about 2.0 kg in the weight panel if each panel uses its observed range.

Thus, separate scales are a sensible choice for inspecting the pattern within each variable. They do not support the claim that one trace varies more in absolute terms merely because it occupies the same fraction of its panel. Since the units are not the same, neither a shared numerical axis nor equal line height supplies a direct comparison of the variables’ scientific variability. The axis labels must identify cm and kg, and the scale policy should be reported.

A plot can also use a shared scale when the panels show the same kind of summary in a common unit—for example, proportions between 0 and 1 for several binary variables. In that situation, a shared range has a direct interpretation. If the summaries differ in kind, such as a mean in one panel and a standard deviation in another, a common axis can invite an invalid comparison even if the numbers happen to be similar. Keep the summary definition visible in labels or panel titles.

Constructing and Reading the Faceted Display

Before plotting, form a long-format set of records with one row for each variable, chain, and iteration. Each record contains the variable label \(j\), chain label \(m\), iteration \(t\), and summary value \(S_{jmt}\). The faceting operation uses the variable label to assign panels, while line grouping and color use the chain label. This organization prevents a common plotting error: connecting the last point of one chain to the first point of another.

1
Choose a summary and a window.
Specify what is summarized for each variable and which iterations are shown. Apply the same iteration window to all chains and panels unless there is a justified reason not to.
2
Verify comparability.
Check that each panel has a clearly named summary and unit. Decide whether a common y-axis is interpretable; otherwise use panel-specific scales and state that choice.
3
Map chains consistently.
Use the same chain colors or line types in every panel, and group observations by both variable and chain so lines are not accidentally joined across chains.
4
Inspect both within-panel and across-panel patterns.
Look for trends, abrupt changes, or chains that behave differently within a variable. Use cross-panel comparisons only to the extent supported by the scale and summary definitions.

Worked Example: Calculating and Faceting Chain Summaries

Consider a hypothetical continuous variable \(X\). At iteration 12, chain 1 has three imputed values 4, 5, and 6 units, while chain 2 has 5, 6, and 7 units. For this illustration, the summary is the mean of those imputed values. The chain-level means are

$$ S_{X,1,12}=\frac{4+5+6}{3}=5,\qquad S_{X,2,12}=\frac{5+6+7}{3}=6. $$

At iteration 13, suppose the corresponding values are 5, 5, and 6 for chain 1, and 6, 6, and 7 for chain 2. Then

$$ S_{X,1,13}=\frac{5+5+6}{3}=\frac{16}{3}=5.333,\qquad S_{X,2,13}=\frac{6+6+7}{3}=\frac{19}{3}=6.333. $$

The plot records these four points in one panel for \(X\), with iteration on the horizontal axis and a separate line for each chain. If another variable \(Y\) is also summarized, its corresponding points belong in a separate panel. The chain color should remain the same in both panels. The calculation shows exactly what each point means; it does not establish that the chains have stabilized, because two iterations are not enough to assess a longer trajectory.

What Facets Can Reveal—and What They Cannot

The main benefit of a faceted display is localization. If most panels look stable but one shows a sustained upward pattern, the display points the analyst toward a variable-specific issue for closer investigation. If chains separate in one panel but overlap in others, the difficulty may be concentrated in that variable’s conditional imputation behavior. Those observations are diagnostic clues, not explanations by themselves. The plot cannot determine whether the cause is the conditional model, data sparsity, predictor choice, or an insufficient run.

Faceting also prevents a large number of traces from becoming a single unreadable overlay. However, adding too many panels can create a new problem: each becomes too small to inspect, and labels may be truncated. Arrange variables in a meaningful order, use readable panel titles, and avoid plotting so many chains or summaries that the individual trajectories disappear. If a display is split across pages or figures, preserve axes and legends consistently and state the split.

A panel-specific scale can expose a subtle drift that a shared scale hides, but it may also make that drift look more dramatic than its numerical size warrants. Conversely, a shared scale can make a low-range trace appear flat. It is often useful to inspect both views when the scientific question requires both within-variable detail and absolute numerical context. If both are shown, label them clearly rather than allowing readers to assume that two figures use the same scale.

Worked Example: Locating a Variable-Specific Pattern

Suppose a hypothetical analysis plots the imputed means of three continuous variables across 40 iterations for two chains. In the panel for \(A\), both chains fluctuate around 10 units without a persistent direction. In the panel for \(B\), chain 1 moves from about 20 to 22 units and chain 2 from about 20.5 to 22.5 units over the displayed range. In the panel for \(C\), the chains fluctuate around 100 units, with no obvious sustained direction. These are visual descriptions, not claims about the probability of convergence.

If all panels share a y-range of 0 to 110, the 2-unit changes in \(B\) occupy only \(2/110\), or about 1.82%, of the full vertical range. This can make the pattern hard to see. With a free scale in \(B\), a range such as 19 to 23 makes the movement visible, but the 2-unit rise then spans \(2/4=0.5\), or half of that panel. The correct conclusion is that the display has made a possible trend in \(B\) easier to inspect—not that \(B\) has changed more than \(C\) in relative or scientific importance.

The next diagnostic step is to investigate \(B\) using the broader MICE diagnostics appropriate to the analysis, while checking that the summary and plotted iteration window are correct. A faceted trace plot identifies where to look; it does not by itself identify the cause or certify that the other variables are satisfactory.

Assumptions, Diagnostics, and Common Pitfalls

A meaningful faceted comparison requires the following conditions. First, each \(S_{jmt}\) must be computed by a consistent rule within its panel. Second, chains must be labelled and plotted consistently. Third, the iteration index must refer to the intended sequence of the MICE algorithm, and the plotted window must be specified. Finally, scales must be chosen so that visual comparisons match the question being asked. If a chain is restarted or iterations are omitted, the discontinuity or omission should not be hidden by connecting points as though no interruption occurred.

  • Misreading free scales. The wrong reasoning is, “The trace fills more of its panel, so this variable changes more.” With free scales, panel heights are rescaled separately. Compare numerical changes using the axis ticks, not the fraction of panel occupied.
  • Relying on a shared scale despite incompatible units. A shared axis does not make quantities such as age and concentration commensurate. Use separate scales for within-variable inspection and explain why cross-variable magnitude comparisons are not appropriate.
  • Inconsistent chain encoding. If colors change meaning between panels, apparent chain differences can be artifacts of the legend. Keep the mapping fixed across the whole display.
  • Overstating visual stability. A flat-looking trace over a short interval is not proof of convergence. A display is one diagnostic view and should be interpreted with other relevant evidence.
  • Comparing unlike summaries. A mean and a quantile may be plotted in separate panels, but their movements do not have identical interpretations. Label each summary and avoid treating matching numerical values as equivalent behavior.

The most useful design is not always the most visually uniform one. Shared axes emphasize absolute numerical scale when that comparison is valid; free axes emphasize within-panel detail. Neither choice repairs a poorly specified imputation model, and neither is a substitute for examining the data and the behavior of the chains. The display is successful when it makes the intended comparisons visible without implying comparisons the scales do not support.

Key takeaway: Facet by imputed variable, align iterations, and encode chains consistently. Use shared y-scales only when units and summaries make cross-panel distances interpretable; use free scales to reveal within-variable patterns, while explicitly avoiding comparisons of apparent line height across panels.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. Two panels use free y-scales. A trace moves through 40% of the panel height in the first and 10% in the second. Can you conclude that its numerical change is four times larger in the first? Explain.
  2. For one chain, the imputed values at an iteration are 2, 4, and 6 units. Calculate the mean summary to plot.
  3. Several panels show the same binary-variable proportion summary. What y-scale choice makes numerical comparison across panels direct, and why?
  4. In a faceted plot, chain 1 is blue in one panel and red in another, while the legend is shared. What is the problem and how should the display be corrected?
  5. A trace appears flat in a panel with a shared y-axis spanning 0 to 100. State one possible explanation and one limitation of the visual conclusion.

Solutions. (1) No. Free scales can map different numerical ranges to the same panel height, so the fractions alone do not determine the numerical changes; read the axis ticks. (2) The mean is \((2+4+6)/3=12/3=4\) units. (3) A shared y-scale, commonly 0 to 1 for proportions, makes equal vertical distances represent equal proportion changes in every panel. (4) The same color has inconsistent meaning across panels, so chain identities are difficult to follow; assign each chain one fixed color or line type throughout. (5) The trace may have small numerical variation relative to the broad shared range, making it look flat. That appearance does not establish convergence; inspect a suitably scaled panel and use other relevant diagnostics.

Clinical Biostats