Tutorials › Exam PA - Predictive Analytics › Choosing Charts for Model Results

Exam PA · Reports for Decision-Makers · Tutorial 785 of 966

Choosing Charts for Model Results

Choose a chart to fit the model question, and present its evidence without hiding important patterns or comparisons.

Intermediate 12 min read

What You'll Learn

  • Match distributions, comparisons, error patterns, and predicted outcomes to suitable chart types
  • Distinguish histograms of numerical values from bar charts of categories
  • Build a fair visual comparison of model performance on the same validation data
  • Use residual-versus-fitted plots to look for systematic error patterns
  • Show time-ordered predictions without implying that forecasts are observed outcomes
  • Identify axis choices and chart forms that can mislead readers

Choose the Chart After You Name the Question

A chart is useful when it helps a reader answer a specific question about a model result. A histogram can show whether prediction errors are concentrated near zero or include a long tail. A dot plot can make two models’ performance easy to compare. A residual plot can expose a pattern that a single summary metric hides. A line chart can show how predicted outcomes vary over time. None of these charts is automatically the right choice: the variable, comparison, and audience determine the form.

Before choosing a chart, state what each mark will represent and which population or validation sample is being shown. Keep that scope consistent with the report’s stated prediction scope. Label quantities with their units, and distinguish observed values from model predictions. A chart that answers a different question, or leaves those distinctions unclear, can give a technically accurate but practically misleading impression.

Definition: A chart for model results is a visual display of a defined quantity, such as an observed value, a prediction, a performance measure, or a prediction error. The chart type should match the quantity’s scale and the question being asked. A residual for observation \(i\) is the observed outcome minus its prediction, \(e_i=y_i-\hat{y}_i\). For a numeric outcome, a positive residual means the prediction was below the observed value; a negative residual means it was above.
Report questionUseful chartImportant choice
How are numeric values or errors distributed?Histogram; sometimes a boxplotUse meaningful, consistent bins when distributions are compared.
How do categories or model results compare?Bar chart for category counts; dot plot for numeric measuresUse the same measure, validation data, and scale for a fair comparison.
Do errors vary with predicted values?Residual-versus-fitted scatter plotShow a zero reference and retain individual observations when possible.
How do predictions change over time?Line chart for ordered time periodsSeparate observed history from forecast periods.

Distributions and Comparisons

A histogram is appropriate for a numeric quantity when the question concerns its distribution. Its bars represent intervals of values, and adjacent intervals normally touch. The height can show counts or proportions; say which one is used. A bar chart instead compares distinct categories, such as model names or regions. Its bars are separated because the categories are not intervals on a continuous number line.

A boxplot summarizes a distribution compactly using its median, quartiles, and possible outlying observations. It is useful when many groups need a compact comparison, but it does not display every value or reveal all distribution shapes. A histogram can better show features such as more than one concentration of values. Select the display that retains the evidence relevant to the report question.

For model comparisons, a dot plot often makes small differences in numeric performance measures easy to see without the visual weight of bars. A bar chart may also be suitable, especially for a small set of categories, provided its scale is clear. Use the same validation sample and metric for each model; otherwise, differences in the chart may reflect different evaluation conditions rather than model performance. State whether higher or lower values are preferable.

Worked Example: Showing the Distribution of Prediction Errors

A hypothetical validation sample contains 10 absolute prediction errors, measured in thousands of dollars: 0.2, 0.5, 0.7, 0.9, 1.1, 1.3, 1.7, 2.1, 2.4, and 4.1. The report question is whether errors are generally small and whether the sample includes a large error. Choose a chart and calculate the values to display.

Method. Use a histogram with bins of width 1 thousand dollars. Define the bins as \([0,1)\), \([1,2)\), \([2,3)\), \([3,4)\), and \([4,5)\), so every value belongs to exactly one bin.

The first bin contains 0.2, 0.5, 0.7, and 0.9: count 4, proportion \(4/10=0.40\). The second contains 1.1, 1.3, and 1.7: count 3, proportion \(3/10=0.30\). The third contains 2.1 and 2.4: count 2, proportion \(2/10=0.20\). The fourth contains no values: count 0, proportion \(0/10=0.00\). The fifth contains 4.1: count 1, proportion \(1/10=0.10\). The counts sum to \(4+3+2+0+1=10\), and the proportions sum to 1.00.

The errors total \(0.2+0.5+0.7+0.9+1.1+1.3+1.7+2.1+2.4+4.1=15.0\), so their mean is \(15.0/10=1.5\) thousand dollars. The sorted fifth and sixth values are 1.1 and 1.3, so the median is \((1.1+1.3)/2=1.2\) thousand dollars. The histogram displays that most errors are below 2 thousand dollars, while one is much larger, information a single average alone would not show.

Common mistake avoided. Treating the error values as categories and making a separated bar for every distinct value would not show their distribution as clearly. The bins are numerical intervals, so adjacent histogram bars are appropriate. The bin boundaries and width should be stated because different choices can change the appearance.

Use Error Plots to Look for Patterns

For a numeric outcome, plot residuals against fitted values when the question is whether prediction errors vary systematically across the range of predictions. Put fitted values on the horizontal axis and residuals on the vertical axis. A horizontal reference at zero distinguishes overprediction from underprediction. A roughly patternless cloud around zero is consistent with no obvious systematic error pattern in this view; it does not prove that a model is adequate.

The reason this plot is informative follows directly from the residual definition. If \(\hat{Y}\) is the prediction and \(Y\) the observed outcome, then for observations with prediction \(t\), the mean residual is:

$$ E[Y-\hat{Y}\mid \hat{Y}=t] =E[Y\mid \hat{Y}=t]-t. $$

The equality holds because, conditional on \(\hat{Y}=t\), the predicted value is \(t\), so it can be taken outside the conditional expectation. Thus, a systematic departure of mean residuals from zero indicates that observed outcomes tend to differ from predictions at those fitted values. Individual points can be noisy, so the plot is evidence to investigate, not a proof of the cause.

Do not connect residual points in observation order unless that order itself is meaningful, such as time. Connecting unrelated policy records can create an apparent trend that depends only on row order. If error variability grows with fitted values, a widening scatter may also matter; a single overall error measure can conceal that feature.

Worked Example: Diagnosing a Pattern in Residuals

A hypothetical model predicts annual repair cost, in hundreds of dollars, for five service contracts. The fitted values are 2, 4, 6, 8, and 10; the observed values are 3, 6, 9, 12, and 15. Calculate the residuals and select a chart to investigate the error pattern.

Method. Calculate each residual as observed minus predicted. The residuals are \(3-2=1\), \(6-4=2\), \(9-6=3\), \(12-8=4\), and \(15-10=5\), all in hundreds of dollars.

Plot the five points \((2,1)\), \((4,2)\), \((6,3)\), \((8,4)\), and \((10,5)\), with fitted value on the horizontal axis and residual on the vertical axis. Include a horizontal zero line. Every residual is positive, and the residual increases as the fitted value increases. In this sample the model underpredicts at all five fitted values, with increasingly large errors.

Check. Adding each prediction and its residual recovers its observation: \(2+1=3\), \(4+2=6\), \(6+3=9\), \(8+4=12\), and \(10+5=15\). The calculation is consistent with the definition. The scatter plot, rather than a chart of residuals connected in arbitrary record order, directly addresses whether error is related to the fitted value.

Common mistake avoided. Plotting observed cost alone against fitted cost is not the same as plotting residuals against fitted cost. The residual plot gives the zero reference a direct meaning: positive values are underpredictions and negative values are overpredictions.

Show Predicted Outcomes in Their Natural Order

The prediction itself determines the chart. For predictions across ordered periods, a line chart can show the time pattern; connecting points is meaningful because adjacent periods have an order. For predictions across unordered groups, use separate points or bars rather than connecting them. If a chart includes both observed outcomes and predictions, use distinct visual marks and label the forecast boundary so readers do not mistake a prediction for an observed result.

A histogram of predictions answers how predicted values are distributed across a scored population; it does not show how predictions change over time. Conversely, a time series of predicted totals does not by itself describe the spread of individual predictions. Match the display to whether the report is about a distribution, a comparison, an error pattern, or a sequence of predicted outcomes.

Worked Example: Charting Predicted Outcomes Over Time

A hypothetical service planner reports observed monthly repair counts for January through April of 80, 88, 84, and 92, followed by model predictions for May through August of 95, 99, 97, and 104. The question is how the predicted monthly count changes relative to recent observed history. Choose a chart and calculate a summary to check the values.

Method. Use a line chart with month in chronological order on the horizontal axis and repair count on the vertical axis. Plot observed values from January through April with one mark style and predicted values from May through August with another. Mark the transition between April and May; do not represent the four predictions as observed counts.

The observed total is \(80+88+84+92=344\), giving an observed four-month average of \(344/4=86\). The predicted total is \(95+99+97+104=395\), giving a predicted four-month average of \(395/4=98.75\). The difference in these period averages is \(98.75-86=12.75\) repairs per month. This comparison is descriptive: it contrasts the displayed historical period with the displayed forecast period, not two observed samples.

The plotted predictions rise from 95 in May to 99 in June, fall to 97 in July, and rise to 104 in August. The check \(95+99+97+104=395\) confirms the forecast total and average. The line chart preserves the ordering and makes the July dip visible; a bar chart of four unlabeled categories would not communicate the sequence as directly.

Common mistake avoided. Joining all eight values with an undifferentiated line can make the forecast look like observed history. Distinct marks and a clear April-to-May boundary preserve the difference in status.

Visual Choices That Can Hide Evidence

A chart can distort a comparison even when its data are correct. For bars representing counts or amounts, a vertical axis that begins far above zero can exaggerate differences in bar length. If a truncated scale is genuinely needed to show small variation, make the scale explicit and avoid relying on bar length as though the axis began at zero. For dot plots of numeric measures, a narrower scale may be useful, but readers need visible axis values and units.

Other choices can also obscure the answer: three-dimensional bars distort apparent size; too many colors or categories compete for attention; and different bin boundaries can make two histograms look more different than they are. Pie charts make precise comparisons difficult when there are several similar-sized categories. Prefer a simple display with a clear purpose, consistent scales for comparisons, and labels that identify the measure and population.

Key takeaway: First name the question, then choose the chart: histograms for numeric distributions, bars for categories, dot plots for numeric comparisons, residual-versus-fitted plots for error patterns, and line charts for ordered predictions. Check that axes, scales, and visual distinctions preserve the evidence.

Check Your Understanding

For each situation, choose a chart and check the calculation or interpretation stated in your answer.

  1. A validation set has 20 numeric absolute errors. The report asks what fraction is below 500 dollars and whether a long upper tail is present. Which chart is suitable, and what must be specified about its intervals? (Answer: A histogram; specify the bin boundaries and whether heights show counts or proportions.)
  2. Two models have RMSE values of 2.4 and 2.1 thousand dollars on the same validation sample. Which model has lower RMSE, and what chart is suitable for comparing the values? (Answer: The model with RMSE 2.1; a dot plot on a shared, labeled scale is suitable.)
  3. For three records, observed outcomes are 8, 11, and 15, while predictions are 10, 10, and 12. Calculate the residuals and choose a chart to examine whether they relate to fitted values. (Answer: Residuals are \(-2\), \(1\), and \(3\); use a residual-versus-fitted scatter plot with a zero reference.)
  4. A report shows observed weekly counts of 40 and 44, followed by predictions of 48 and 46. What is the predicted-period average, and how should the display distinguish the values? (Answer: \((48+46)/2=47\) counts per week; use a time-ordered line chart with distinct observed and predicted marks and a boundary.)
  5. A reviewer proposes a histogram of model names to compare three RMSE values. What is the problem, and what should replace it? (Answer: Model names are categories, but RMSE is numeric; use a dot plot or a clearly scaled bar chart, with the same validation sample and a stated direction of preference.)
Clinical Biostats