Introduction
A relationship plot is most useful when it does more than show that two variables move together. It should make the variables and units clear, reveal how observations are distributed, and help us describe the form and strength of the pattern without claiming more than the data support. In this case study, we examine a small, hypothetical set of vehicles to see how fuel economy varies with engine size and vehicle class.
The aim is to make and interpret the plot, not to calculate a regression equation. We will compare the overall pattern with the class-specific patterns, use a LOESS smoother as a visual aid, and inspect curvature, vertical spread, clusters, and gaps. Every vehicle and value below is invented for teaching.
The Hypothetical Data
Suppose a researcher records engine displacement in liters and fuel economy in miles per gallon (mpg) for 16 vehicles. Each vehicle is also classified as compact, midsize, or SUV. The table lists the observations; each row represents one vehicle.
| Class | Engine size (L) | Fuel economy (mpg) |
|---|---|---|
| Compact | 1.2 | 34 |
| Compact | 1.4 | 32 |
| Compact | 1.5 | 31 |
| Compact | 1.6 | 30 |
| Compact | 1.8 | 28 |
| Compact | 2.0 | 26 |
| Midsize | 1.8 | 29 |
| Midsize | 2.0 | 27 |
| Midsize | 2.2 | 26 |
| Midsize | 2.4 | 24 |
| Midsize | 2.6 | 22 |
| SUV | 2.0 | 23 |
| SUV | 2.5 | 21 |
| SUV | 3.0 | 19 |
| SUV | 3.5 | 17 |
| SUV | 4.0 | 13 |
Worked Example: Setting Up the Relationship Plot
Suppose we are preparing a scatterplot from the table. Which variable belongs on each axis, and how should vehicle class be shown?
Horizontal axis: engine size, from 1.2 L to 4.0 L. This is the predictor-like quantity for the plot, so the horizontal axis makes it possible to compare fuel economy at different engine sizes.
Vertical axis: fuel economy, from 13 mpg to 34 mpg. This is the response quantity being compared across engine sizes.
Group encoding: use a distinct point shape or color for compact, midsize, and SUV. Include a legend that identifies each class. A title such as “Fuel Economy by Engine Size and Vehicle Class” and axis labels with units make the display interpretable without requiring the reader to infer what the numbers mean.
Use one common pair of axes for all classes. Separate panels could be useful for another purpose, but placing the groups together makes their overlap and differences visible. Because several vehicles share an engine size of 2.0 L, some points have the same horizontal coordinate; separate symbols or a small amount of transparent plotting can help reveal overlapping observations without changing their recorded values.
Read the Overall Pattern and the Groups
Across the full data set, larger engine sizes generally accompany lower fuel economy. The overall direction is therefore negative. But an overall direction alone is incomplete: the plot should also be read for form, strength, vertical spread, and the way the groups are arranged. The points are not all on one narrow path, and the classes occupy different parts of the display.
The classes overlap in engine size from 1.8 L to 2.0 L for compact and midsize vehicles, and at 2.0 L all three classes appear. At that engine size, the recorded fuel economies are 26 mpg for the compact, 27 mpg for the midsize, and 23 mpg for the SUV. This comparison illustrates why class symbols matter: vehicles with the same recorded engine size can have different fuel-economy values, and the class labels help show how observations are grouped.
The class groups do not have equal sample sizes. There are 6 compact vehicles, 5 midsize vehicles, and 5 SUVs. A pooled average therefore reflects both the class-specific values and how many vehicles are recorded in each class. It should not be mistaken for an average that gives each class equal weight.
Worked Example: Checking the Pooled Fuel-Economy Average
Calculate the overall mean fuel economy from the raw values, then compare it with a calculation that uses the class means.
For the compact vehicles, the sum is \(34+32+31+30+28+26=181\) mpg, so the class mean is \(181/6=30.1667\) mpg. For midsize vehicles, the sum is \(29+27+26+24+22=128\) mpg, giving a mean of \(128/5=25.6\) mpg. For SUVs, the sum is \(23+21+19+17+13=93\) mpg, giving a mean of \(93/5=18.6\) mpg.
The overall mean from all 16 raw values is
The same result follows by weighting each class mean by its class size:
This weighting identity holds because the sum of all observations is the sum of the class sums, and each class sum equals its sample size multiplied by its class mean. If instead we use the rounded class means 30.17, 25.60, and 18.60, the displayed calculation is approximately \([6(30.17)+5(25.60)+5(18.60)]/16=25.126\) mpg. That slight difference is due to rounding the class means before combining them; the calculation with the exact class sums gives 25.125 mpg.
Adding and Interpreting a LOESS Smoother
A LOESS smoother can be added to summarize how the center of the observed response values changes across the horizontal axis. At each location along the engine-size axis, LOESS uses nearby observations, with weights that depend on distance, to produce a locally smoothed value. The resulting curve is a descriptive guide to the plotted data. It is not a regression equation, and it does not imply that the relationship has a particular causal explanation.
For this data set, a plotted LOESS curve would be expected to descend overall: lower fuel-economy values occur more often toward the larger engine sizes. The pattern also suggests some bending rather than a perfectly straight decrease. In the smaller-engine region, the observed values tend to be higher; at larger sizes, the values continue to fall, with the SUV observations extending to the lowest fuel economies. Because the sample contains only 16 observations and the classes occupy different regions, the precise curve depends on the smoother settings and should not be treated as a stable numerical summary.
Worked Example: Describing Direction, Form, and Class Differences
Imagine viewing the scatterplot with a LOESS curve and the three class symbols. Write a concise description that is supported by these observations.
Direction: The overall association is negative: the vehicles with the largest engine sizes in this set generally have lower fuel economy than those with the smallest engine sizes.
Form: The decrease is not perfectly represented by a straight path. The plotted values suggest a broad downward bend, particularly as the largest engine sizes are reached. The small sample makes it unwise to claim that the precise degree of curvature is well established.
Groups: Compact vehicles are concentrated at smaller engine sizes and higher fuel-economy values, while SUVs occupy much of the larger-engine, lower-fuel-economy region. Midsize vehicles lie between these concentrations, with some overlap. Thus, the overall pattern combines within-class and between-class placement; it should not be described as if class were irrelevant.
Strength: The overall negative pattern is visible, but fuel economy is not determined by engine size alone in these observations. For example, at 2.0 L the three class values range from 23 to 27 mpg. A description such as “a clear negative association with noticeable class differences and some scatter” is more informative than calling the relationship either perfect or nonexistent.
Inspecting Spread, Clusters, and Gaps
A relationship plot also shows how far the observed responses vary vertically at different predictor values. Here, the compact observations range from 26 to 34 mpg, midsize observations from 22 to 29 mpg, and SUV observations from 13 to 23 mpg. These ranges are not direct measures of conditional spread at every engine size: there are few observations at any single size, and the classes occupy different regions. Still, the plot prompts a useful question: does the vertical scatter around the broad trend appear to change as engine size increases?
A few observations at the same engine size cannot establish a general pattern of changing spread. In particular, the three points at 2.0 L are from three different classes, not three repeated measurements of a typical vehicle under otherwise identical conditions. Visual assessment of spread should therefore be cautious and should account for group membership.
The points form recognizable class concentrations: compact vehicles are mostly at smaller engine sizes, midsize vehicles occupy a middle region, and SUVs extend toward larger sizes. These are groups in the plotted data, not necessarily evidence of separate natural populations. The engine-size values also become less frequent at the upper end: the SUV observations occur at 2.5, 3.0, 3.5, and 4.0 L, with no observations between 2.6 L and 3.0 L. Conclusions about the trend in such sparsely represented regions are limited.
Worked Example: Identifying a Sparse Region and Limiting a Claim
A reader notices that fuel economy is low at 4.0 L and proposes, “All vehicles with engine sizes between 2.6 L and 4.0 L have fuel economy between 13 and 19 mpg.” Is that conclusion justified by the plot?
No. The data include no observations between 2.6 L and 3.0 L, and only four SUV observations at 2.5, 3.0, 3.5, and 4.0 L cover the larger-engine region. The observed values at 3.0, 3.5, and 4.0 L are 19, 17, and 13 mpg, but those three values do not establish the fuel economy of every vehicle in that range.
A defensible description is narrower: “In this hypothetical sample, the observed SUVs at 3.0, 3.5, and 4.0 L have fuel economies of 19, 17, and 13 mpg, respectively; the region between 2.6 and 3.0 L has no recorded vehicles.” This reports what is plotted and makes the data gap explicit rather than filling it with an unsupported claim.
A Practical Plotting and Reading Sequence
A consistent sequence helps keep a case study focused on the data rather than on a premature conclusion. The following steps combine plot construction with interpretation.
Put engine size in liters on the horizontal axis and fuel economy in miles per gallon on the vertical axis. Identify each point as one vehicle.
Use a clear symbol or color for each vehicle class and include a readable legend. Check for overlapping points, especially at repeated engine sizes.
State the overall direction and form, then inspect vertical scatter, class concentrations, unusual points, and sparse regions.
Use it to summarize the broad local pattern, while checking whether groups or gaps could affect how the curve appears.
Describe the observed association in context. Note limitations where the sample is small or engine sizes are sparsely represented.
Common Mistakes
- Reporting only the overall direction. “Fuel economy decreases as engine size increases” omits the class concentrations, scatter, curvature, and gaps that are visible in this example. Add those features when they matter to the interpretation.
- Treating the smoother as the data. A curve is a summary, not a set of additional observations. Check the individual points and groups before describing the relationship.
- Giving every class equal weight without saying so. The pooled mean uses each vehicle once, so classes with more observations contribute more. An equally weighted average of class means answers a different question.
- Filling in a gap by eye. A smooth-looking curve across an empty region does not provide observed evidence there. State where the data are sparse and limit the conclusion.
- Reading group differences as a causal effect. This plot describes association in the recorded vehicles. Differences may reflect other characteristics or how the vehicles entered the sample; the plot alone does not establish that changing engine size would cause a particular change in fuel economy.
Check Your Understanding
Use the hypothetical vehicle data and the plotting principles in this case study.
- Which variable belongs on each axis, and what units should appear in the labels?
- Why is the overall mean fuel economy weighted by the number of vehicles in each class rather than by giving each class an equal contribution?
- At an engine size of 2.0 L, what are the three recorded fuel-economy values, and why do the class symbols help interpret them?
- What feature of the data limits conclusions about vehicles between 2.6 L and 3.0 L?
- Give one appropriately cautious sentence describing the overall association and one limitation of the LOESS curve in this small data set.