Why Look at Both Margins and the Joint Pattern?
A scatterplot shows paired values: which value of one variable occurred with which value of another. Separate plots of the variables show their individual distributions but discard those pairings. Those views answer different questions. A value can be extreme in one variable without being especially unusual given the other variable, while a pair can stand apart from the main scatterplot pattern even when neither value is individually extreme.
This distinction matters when reviewing data. A large annual exposure might be plausible alongside a large premium, for example, but surprising alongside a small premium if the data generally show premiums rising with exposure. A boxplot can flag the exposure as extreme; only the paired view can help assess whether the combination fits the observed pattern. Neither plot, alone or together, proves that a record is erroneous.
In this tutorial, “bivariate outlier” is used in the broad, practical sense of an observation unusual in the joint scatterplot. Different methods may use the term more narrowly. Always state what makes the observation unusual: an extreme coordinate, an unexpected combination, or both.
Separate Distributions and Their Fences
For a quantitative variable, a boxplot summarizes its marginal distribution using its quartiles and median. The interquartile range is \(IQR=Q_3-Q_1\). Under the 1.5 IQR rule, the lower and upper fences are \(Q_1-1.5IQR\) and \(Q_3+1.5IQR\). A value outside a fence is flagged for investigation. It is not automatically an error, nor does the rule account for its pairing with another variable.
For a scatterplot with variables \(X\) and \(Y\), calculate the fences separately for \(X\) and \(Y\). A point outside the fence for \(X\) is marginally extreme in \(X\); a point outside the fence for \(Y\) is marginally extreme in \(Y\). The scatterplot then adds information about whether the pair is unusual relative to the joint pattern.
The same calculation gives \(L_Y\) and \(U_Y\). These are screening thresholds, not probabilities or confidence limits. Their usefulness depends on the data’s scale and distribution, so inspect the variable’s units and shape before interpreting a flag. The earlier material on the 1.5 IQR rule and on unusual predictor values in scatterplots provides useful context for these checks.
Why the Two Views Can Disagree
Separate distributions preserve which \(X\) values and which \(Y\) values were observed, but they do not preserve which values occurred together. To see why this matters, take \(X\) values \(1,2,3\) and \(Y\) values \(1,2,3\). Pair them in order and the points are \((1,1),(2,2),(3,3)\), which form an increasing pattern. Pair the same \(X\) values with \(Y\) in reverse order and the points are \((1,3),(2,2),(3,1)\), which form a decreasing pattern. The marginal values—and therefore their separate boxplots—are identical. The joint patterns are different because the pairings differ.
This is the key justification for checking both views: a marginal summary cannot determine whether a particular pair fits the observed relationship. A scatterplot preserves the pairings and makes the relationship available for visual inspection. Conversely, a scatterplot alone can make it difficult to judge how far a coordinate lies into a variable’s marginal distribution. Reading the views together gives a more complete diagnosis.
Review its units, distribution, and boxplot flags. Calculate each variable’s fences if a numerical marginal screen is needed.
On the scatterplot, identify whether the point is far from the main cloud, lies away from a visible trend, or sits near the edge of the cloud.
Say which coordinate is marginally flagged and whether the pair seems unusual relative to the joint pattern. Do not treat either observation as proof of bad data.
Verify units, entry, and the case’s substantive meaning before deciding how to handle it. Preserve a plausible observation unless there is a defensible reason to correct or exclude it.
Worked Examples
Worked Example: Extreme in One Margin, Not Necessarily in Both
A hypothetical portfolio review compares annual exposure \(X\), in thousands of dollars, with annual premium \(Y\), also in thousands of dollars. For the reference portfolio, the \(X\) boxplot has \(Q_1=12\) and \(Q_3=20\); the \(Y\) boxplot has \(Q_1=7\) and \(Q_3=13\). One record is \((35,20)\). Determine its marginal flags and explain what the scatterplot is needed to assess.
Method. Calculate the 1.5 IQR fences for each coordinate, then compare the record with those fences. The summaries are already supplied, so the task is not to reconstruct the reference portfolio’s quartiles.
For exposure, \(IQR_X=20-12=8\). The lower fence is \(12-1.5(8)=12-12=0\), and the upper fence is \(20+1.5(8)=20+12=32\). The record’s exposure is \(35>32\), so it is flagged as marginally high in \(X\).
For premium, \(IQR_Y=13-7=6\). The lower fence is \(7-1.5(6)=7-9=-2\), and the upper fence is \(13+1.5(6)=13+9=22\). The record’s premium is \(20\), which is between \(-2\) and \(22\), so it is not flagged in \(Y\).
Conclusion. This record is marginally extreme in exposure only. The scatterplot is needed to assess whether the pair \((35,20)\) fits the portfolio’s joint pattern. A large \(X\) flag does not, by itself, establish that the combination is unusual or erroneous. The common mistake is to call the whole point an outlier just because one coordinate crosses a marginal fence; the correction is to name the flagged coordinate and inspect the paired plot separately.
Worked Example: Unusual Pair Without a Marginal Flag
In a hypothetical screening study, \(X\) is a site’s weekly visitor count, in tens, and \(Y\) is the number of service requests, also in tens. The reference boxplots have \(Q_{1,X}=10\), \(Q_{3,X}=30\), \(Q_{1,Y}=8\), and \(Q_{3,Y}=24\). Most points in the scatterplot lie near a rising band: sites with more visitors generally have more requests. A site has coordinates \((24,9)\). Decide whether either coordinate is marginally flagged and interpret the pair.
For \(X\), \(IQR_X=30-10=20\). Its fences are \(10-1.5(20)=10-30=-20\) and \(30+1.5(20)=30+30=60\). Since \(-20<24<60\), \(X=24\) is not flagged.
For \(Y\), \(IQR_Y=24-8=16\). Its fences are \(8-1.5(16)=8-24=-16\) and \(24+1.5(16)=24+24=48\). Since \(-16<9<48\), \(Y=9\) is not flagged either.
Joint check. Both coordinates are within their marginal fences. Yet \(X=24\) is toward the higher part of its reference range, while \(Y=9\) is near the lower quartile. If the scatterplot’s rising band is clear and this point lies well below it, the combination is visually unusual relative to the observed relationship. The data support describing it as a possible joint anomaly, not as a marginal extreme.
The common mistake is to stop after finding that both values lie within their fences. The correction is to remember that fences assess each variable separately; they do not assess whether the two values are an unusual pairing. The scatterplot supplies that additional visual check.
Worked Example: Extreme in Both Margins but Consistent With the Joint Pattern
A hypothetical analysis compares a device’s operating hours \(X\) with its annual maintenance cost \(Y\), measured in thousands of dollars. The reference summaries are \(Q_{1,X}=8\), \(Q_{3,X}=18\), \(Q_{1,Y}=20\), and \(Q_{3,Y}=40\). The scatterplot’s main cloud follows a rising pattern, and a device is recorded at \((42,89)\). Assess its marginal and joint status.
For operating hours, \(IQR_X=18-8=10\). The fences are \(8-1.5(10)=8-15=-7\) and \(18+1.5(10)=18+15=33\). Since \(42>33\), the \(X\) value is marginally high.
For maintenance cost, \(IQR_Y=40-20=20\). The fences are \(20-1.5(20)=20-30=-10\) and \(40+1.5(20)=40+30=70\). Since \(89>70\), the \(Y\) value is also marginally high.
The point is extreme in both marginal distributions. But the rising scatterplot pattern indicates that higher operating hours tend to accompany higher costs. If \((42,89)\) lies near the extension of that pattern rather than far away from it, it may be consistent with the joint relationship despite its marginal extremes. The plot alone does not establish that it is correct; verify the units and record before drawing a data-quality conclusion.
The common mistake is to infer that two marginal flags necessarily make a point a joint outlier. The correction is to distinguish “extreme on both axes” from “unusual relative to the relationship.” A point can satisfy the first description without satisfying the second.
Putting the Checks Into Practice
In R, the basic sequence is to inspect a boxplot for each variable and a scatterplot of the paired observations. For example, use boxplot(x), boxplot(y), and plot(x, y) when the two numeric vectors are aligned in the same case order. The alignment matters: if the vectors are sorted independently or contain values from different rows, the plotted pairs no longer represent the observed cases.
Before interpreting a suspected point, check that both axes are labeled with units and that the values refer to the same observational units. Consider whether the scale makes a visually large distance meaningful; a change of units can alter the appearance of an axis without changing which cases were observed. If a log scale is appropriate for a strongly skewed variable, interpret the transformed display in its stated scale rather than mixing raw-scale and log-scale distances.
A careful report separates observation from conclusion. For example: “The record exceeds the upper \(X\) fence, while its \(Y\) value is within its fences; the paired point appears near the main scatterplot band.” This is more informative than simply writing “outlier.” If the point lies far from the band, say so and identify whether that judgment is visual. Then investigate the case using source records and subject-matter context.
- Marginal flag: a coordinate crosses the fence for its own variable.
- Jointly unusual: the paired location departs from the visible two-variable pattern.
- Data error: a conclusion requiring evidence such as a confirmed entry or unit mistake, not just an unusual plot.
Check Your Understanding
For each question, distinguish the marginal calculation from what the scatterplot can add.
- A hypothetical data set has \(Q_1=4\) and \(Q_3=10\) for \(X\). Find its 1.5 IQR fences and classify \(X=20\). (Answer: \(IQR=6\); fences are \(-5\) and \(19\); \(X=20\) is flagged high.)
- For a second variable, \(Q_1=15\) and \(Q_3=25\). A record has \(Y=9\). Is it outside either 1.5 IQR fence? (Answer: \(IQR=10\); fences are \(0\) and \(40\); \(Y=9\) is not flagged.)
- In a hypothetical scatterplot, most points form a tight rising band. A case has both coordinates inside their separate fences but lies well below the band. What is the best description? (Answer: Neither coordinate is marginally flagged, but the pair may be jointly unusual relative to the rising pattern.)
- A point crosses the upper fence for both variables and lies close to the continuation of the scatterplot’s rising pattern. What can and cannot be concluded? (Answer: It is marginally high in both variables; its location may be consistent with the joint pattern, but the plots do not prove the record is correct.)
- Two scatterplots use the same observed \(X\) values and the same observed \(Y\) values, but the \(Y\) values are paired with different cases. Could their separate boxplots be identical while their joint patterns differ? (Answer: Yes. The marginal values are unchanged, so the boxplots can be identical; changing the pairings can change the scatterplot pattern.)