Tutorials › Regression Analysis (Undergraduate) › Designing Regression Figures for Reports

Reproducible Analysis and Reporting · Tutorial 957 of 991

Designing Regression Figures for Reports

Build regression figures that make the fitted relationship, uncertainty, and range of observed data clear to readers.

Intermediate 9 min read

What You'll Learn

  • Choose axis labels and units that identify the variables being plotted
  • Distinguish observed data from fitted values and other plotted summaries
  • Select legends and visual encodings that remain readable
  • Show uncertainty with an accurate description of the interval displayed
  • Make the range and distribution of observed predictor values visible
  • Write captions that name the model quantities and relevant context

Why Regression Figures Need Careful Design

A regression figure can make a fitted relationship easier to understand than a table of coefficients, but only if readers can tell what the axes measure, which marks are observations, and what the fitted line or band represents. A polished figure is not automatically an informative one: missing units, a crowded legend, or an uncertainty band without a clear definition can make a correct analysis misleading.

The goal is to show the relationship relevant to the report while preserving its limits. Label the quantities in context, distinguish observed data from model-based quantities, and make clear where the data provide support. A figure should help readers see the analysis, not imply a stronger conclusion than the analysis warrants.

Definition: A fitted-relationship plot displays observed data and one or more quantities estimated from a regression model across values of a predictor. Depending on the purpose, it may show observed responses, fitted mean responses, uncertainty intervals for those means, or predictions for individual responses. The caption should identify which of these quantities appears.

Specify What the Figure Shows

Before choosing symbols or colors, state the model quantities the figure is intended to display. For a simple linear regression, one standard model is

$$ Y_i = \beta_0 + \beta_1 x_i + \varepsilon_i $$

Here \(Y_i\) is the outcome for observation \(i\), \(x_i\) is its predictor value, \(\beta_0\) and \(\beta_1\) are the population intercept and slope, and \(\varepsilon_i\) is the error. The fitted line uses estimated coefficients, \(\hat{\beta}_0\) and \(\hat{\beta}_1\), to display the estimated mean outcome at each predictor value:

$$ \hat{Y}(x) = \hat{\beta}_0 + \hat{\beta}_1 x $$

A fitted mean is not an observed response and is not a prediction interval for a new individual. A graph may show both observed responses and the fitted mean, but its legend and caption must keep them distinct. Likewise, an interval around the fitted mean describes uncertainty about the mean response, whereas a prediction interval describes a range for an individual response under the model. They answer different questions.

Uncertainty intervals should come from the specified model and be named accurately. For the usual pointwise confidence interval for a mean response in simple linear regression, the model assumes a linear conditional mean, independent errors with mean zero and constant variance, and normally distributed errors for the exact \(t\)-based interval. The predictor values are treated as given. If the figure uses a different model or an interval with a different interpretation, say so rather than implying these assumptions and intervals are interchangeable.

Design Choices That Help Readers

  • Label both axes with variable names and units. “Study time (hours)” is more informative than “x.” If a variable has no physical units, use a clear name such as “Treatment group.”
  • Identify the marks. Use points for individual observations and a line for fitted means. If the plot shows group summaries rather than individual data, say so.
  • Use readable legends. Name groups in words, keep the legend near the plotted data when practical, and avoid relying on color alone. Different point shapes or line types can help when a figure is printed in grayscale.
  • Show uncertainty in a legible way. A shaded band or interval bars can work, but the caption should name the interval and the quantity it covers. Do not let shading obscure the observations.
  • Make data support visible. Show the observations, or include an indication of where predictor values occurred. A line extended far beyond the observed predictor range can invite unsupported extrapolation.

Keep the scale honest and useful: axis limits should make the relevant variation readable without concealing important observations. A truncated axis is not automatically wrong, but it should be clearly marked when it could change how readers perceive the size of differences. Avoid decorative effects that add visual emphasis without adding information.

Worked Example: Labeling a Fitted Line in Context

Suppose a hypothetical sample of students has study time, measured in hours, and quiz score, measured in points out of 100, recorded for each student. The fitted model is \(\hat{Y}(x)=18.6+0.42x\), where \(x\) is study time in hours and \(\hat{Y}(x)\) is the fitted mean quiz score in points. Observed study times range from 2 to 10 hours.

Choose the axes. Put “Study time (hours)” on the horizontal axis and “Quiz score (points out of 100)” on the vertical axis. Each student’s observed pair is one point. The fitted line represents estimated mean quiz score, not the score of a particular student.

Calculate plotted fitted values. At 2 hours, the fitted value is \(18.6+0.42(2)=18.6+0.84=19.44\) points. At 10 hours, it is \(18.6+0.42(10)=18.6+4.20=22.80\) points. A line drawn over the observed range should pass through these fitted values at the corresponding horizontal positions.

Show the support. Plot the observed students’ points, rather than drawing the line as if study times beyond 2 to 10 hours had been observed. If many students have similar study times and other parts of the range are sparse, the points make that uneven support visible.

Write a caption. “Points show quiz scores for individual students; the line shows the fitted mean quiz score from a linear regression of score on study time. Study time is in hours and quiz score is in points out of 100; observed study times ranged from 2 to 10 hours.” This identifies the marks, model quantity, units, and observed range. It does not claim that studying more caused higher scores.

Uncertainty Displays and Their Captions

An uncertainty display is useful only when its meaning can be read correctly. For a pointwise confidence interval for the mean response at \(x_0\), the standard form under the stated simple linear regression assumptions is

$$ \hat{Y}(x_0) \mathbin{\pm} t^* SE\bigl(\hat{Y}(x_0)\bigr) $$

Here \(SE\bigl(\hat{Y}(x_0)\bigr)\) is the standard error of the fitted mean at \(x_0\), and \(t^*\) is the critical value for the chosen confidence level and degrees of freedom. This interval concerns the mean response at that predictor value. It is not a claim that a specified percentage of individual responses will fall inside the band. A prediction interval for an individual response is wider because it includes both uncertainty in the estimated mean and individual response variability.

A plotted band may connect pointwise intervals across predictor values. Its caption should call it a pointwise confidence band if that is how it was calculated; it should not imply that it is a simultaneous band covering the entire fitted curve with the stated confidence level. Report the confidence level and identify the covered quantity. Use the interval produced by the model procedure, not a visually chosen width.

Worked Example: Calculating and Describing a Mean-Response Interval

Consider a hypothetical linear regression of quiz score in points on study time in hours, based on 12 students. At 6 hours, suppose the fitted mean score is 21.12 points and its standard error is 0.75 points. Under the simple linear regression assumptions described above, use \(df=n-2=12-2=10\). For a 95% pointwise confidence interval, suppose the appropriate critical value is \(t^*=2.228\).

Calculate the margin of error. \(2.228(0.75)=1.671\) points.

Calculate the interval.

$$ 21.12 \mathbin{\pm} 1.671 = (21.12-1.671,\ 21.12+1.671) = (19.449,\ 22.791) $$

Rounded to one decimal place, the interval is 19.4 to 22.8 points. A shaded band or vertical interval at 6 hours could show this uncertainty about the mean quiz score for students with 6 hours of study time.

Describe it accurately. A suitable caption phrase is “The shaded region shows pointwise 95% confidence intervals for the fitted mean quiz score.” In repeated samples under the model assumptions, this interval procedure would cover the true mean response at a fixed study time in about 95% of samples. The calculated interval is not a 95% probability statement about the fixed mean, nor does it describe where 95% of individual students’ scores lie.

Legends for Groups and Multiple Relationships

When a figure includes multiple groups, the legend should identify what differs: observed group membership, fitted group-specific means, or both. If group-specific fitted lines are shown, distinguish them from the points and state whether the model includes group, predictor, or both. The caption should explain any adjustment when plotted fitted values are adjusted estimates rather than raw group averages.

Worked Example: Making Group Comparisons Readable

A hypothetical report compares systolic blood pressure in millimeters of mercury with age in years for two exercise groups, “Program” and “Comparison.” The fitted model gives a separate estimated mean relationship for each group. The observed ages range from 30 to 65 years in both groups.

Use circles for observed Program participants and triangles for observed Comparison participants. Use a solid line for the Program fitted mean and a dashed line for the Comparison fitted mean. Label the axes “Age (years)” and “Systolic blood pressure (mm Hg).” A legend with the two group names and distinct point and line encodings lets readers distinguish the data from the fitted relationships, even if color is unavailable.

Draw each fitted line only across the ages represented in the observed data, and make the points visible beneath or alongside the lines. A caption could read: “Points show observed systolic blood pressure by age for the Program and Comparison groups; solid and dashed lines show their respective fitted mean relationships from the specified regression model. Age is in years and blood pressure is in mm Hg; observed ages ranged from 30 to 65 years in each group.”

The figure describes model-estimated associations in these data. It does not by itself establish that the exercise program caused any difference. A legend that merely says “Group 1” and “Group 2,” or a caption that fails to identify the lines as fitted means, would make the display harder to interpret.

A Short Justification for Showing the Observed Range

A fitted line is calculated from a model, but it does not mean the data support equally precise conclusions at every possible predictor value. In simple linear regression, the standard error of a fitted mean is smallest near the sample mean of the predictor and increases as \(x_0\) moves away from it. The usual expression makes the reason visible:

$$ SE\bigl(\hat{Y}(x_0)\bigr) = s\sqrt{\frac{1}{n}+\frac{(x_0-\bar{x})^2}{\sum_{i=1}^{n}(x_i-\bar{x})^2}} $$

The second term inside the square root is nonnegative and grows as \(x_0\) moves farther from \(\bar{x}\). Thus, all else equal, uncertainty in the fitted mean increases farther from the center of the observed predictor values. Beyond the observed range, the line is extrapolation: the model supplies a value, but the data offer no direct observations there. Showing the observed points or range helps readers see this distinction.

Common Mistakes and Why They Matter

  • Using unlabeled or unit-free axes. A reader cannot judge the scale or interpret the quantities. Name both variables and give measurement units.
  • Calling a fitted mean an individual prediction. A line through estimated means does not show the likely range of individual outcomes. Identify the line and interval according to the quantity they actually represent.
  • Shading an interval without defining it. A band is not self-explanatory. State whether it is a confidence interval for the mean or a prediction interval for individual responses, and give its confidence level.
  • Drawing the line far beyond the data without explanation. This can make unsupported extrapolations look observed. Show the data range and limit the display to that range unless extrapolation is deliberate and clearly identified.
  • Using a legend that depends on color alone. Colors may be difficult to distinguish or disappear in grayscale. Pair color with labels, line types, or point shapes.
  • Writing a caption that overstates the result. A fitted association in observational data does not establish causation. Describe the plotted quantities and model, not a causal conclusion the figure cannot support.
Key takeaway: A useful regression figure lets readers identify the variables and units, distinguish observations from fitted quantities, understand any uncertainty display, and see where the data support the relationship. A concise caption should make those points explicit.

Check Your Understanding

For each question, focus on what a reader can identify from the figure and its caption.

  1. A graph’s horizontal axis is labeled “x” and the vertical axis “y.” What information should be added to make the axes interpretable?
  2. In a plot of observed responses and a fitted mean line, what does the line represent, and why is it not an individual response prediction?
  3. A shaded band is a 95% pointwise confidence band for the fitted mean. What should the caption say, and what should it avoid claiming about individual responses?
  4. Why can points or another display of the observed predictor range help readers assess a fitted line?
  5. Suggest two ways to distinguish groups in a figure that will remain readable in grayscale.