Outlier Detection: How to Review and Handle Extreme Values
Outlier detection flags observations that depart from the rest so you can investigate their cause and analytical impact. Learn how IQR fences, modified Z-scores, and formal tests differ, when their assumptions apply, how regression leverage differs from influence, and how to validate and report flagged values.
An outlier is an observation that stands apart from the distribution of other observations or from the process that produced the data. A “far from the rest” flag does not prove that a record is wrong, nor does it mean the value should be removed. Compare like with like, investigate whether the value is an error or a real rare event, and then choose a response that fits the analysis goal.
Detection and error verification are different steps
What counts as unusual depends on the population, measurement units, time period, and collection process. A large purchase may look extreme when all customers are combined but ordinary among business accounts. A symmetric rule can also flag valid values in a naturally right-skewed variable such as income or processing time. NIST defines an outlier relative to the other observations and advises first understanding the ordinary shape of the data. NIST: What are outliers in the data?
Separate three questions:
Outlier labeling: mark values for review. Plots, IQR rules, and robust scores can help at this stage.
Formal identification: use a statistical test under specified distributional assumptions and a defined test scope.
Accommodation: if a value is valid but unduly affects an analysis, use a suitable robust method, transformation, or group-specific analysis to address its influence.
NIST distinguishes labeling, formal identification, and accommodation through robust methods. Removing every flagged record collapses these separate decisions into one. NIST overview of detection and tests
Plots and IQR fences identify candidates
Start with a histogram or box plot, then examine scatter plots and time order where relevant. Plots may reveal skew, multiple peaks, process changes, or mixed subgroups, not just extreme values. When comparing groups, plot them separately so that one group's ordinary range is not judged against a different group's distribution.
The interquartile range (IQR) is Q3 minus Q1. A common 1.5 × IQR rule labels observations below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR as potential outliers. Values beyond 3 × IQR may be drawn as more extreme flags. These are screening conventions for a plot, not proof of bad data or automatic deletion rules. NIST: Box Plot
Hypothetical example: if Q1 is 10 and Q3 is 16, then IQR is 6 and the upper 1.5-IQR fence is 25. A value of 32 is flagged by this rule, but the calculation cannot tell whether 32 is a recording error or a genuine large observation. Software can use different quartile conventions, so check the convention when samples are small or values lie near a fence.
Choose scores and tests that fit their assumptions
A modified Z-score uses the median and median absolute deviation (MAD), which are less affected by extremes than the mean and standard deviation. NIST gives the formula Mᵢ = 0.6745(xᵢ − median)/MAD and cites a recommendation to label absolute scores above 3.5 as potential outliers. This is a screening convention, not a universal boundary. Do not apply it mechanically to skewed data, mixed subgroups, or small samples where MAD is zero; inspect the distribution and measurement context first. NIST: Modified Z-scores and cautions
Formal tests require assumptions, including an approximately normal distribution for a single variable in the tests discussed by NIST. Grubbs' test examines one suspected outlier. Generalized ESD can examine multiple candidates when you can set an upper bound on their number. NIST explains that repeatedly applying a single-outlier test may miss values when several are present because they can mask one another; specifying too many candidates can also swamp valid observations. NIST: Generalized ESD Test
A significant test result does not mean “bad data.” Sample size, distribution, a pre-specified analysis plan, and multiple comparisons also matter. Testing many fields automatically can increase accidental flags. Conversely, a test that finds no outlier does not prove that no unusual case matters.
The NIST handbook recounts a South Pole ozone example in which automated screening removed low satellite readings before analysis. Ground-based readings later prompted a review that showed the satellite had recorded the low values but the filter had discarded them. This does not mean every extreme is meaningful; it shows how deletion without investigation can erase a signal. NIST: Histogram interpretation and the ozone example
In regression, distinguish residuals, leverage, and influence
An observation whose outcome Y differs greatly from the model prediction may be a response outlier with a large residual. An observation with an unusual combination of predictors X may have high leverage. An influential point is one whose inclusion or exclusion substantially changes estimates or predictions. A case may meet more than one description, but the terms are not interchangeable.
A high-leverage point can fit the regression line and have little influence. It can also pull the fitted line toward itself, making its ordinary residual look small. Residual plots and studentized residuals help examine unusual outcomes; leverage diagnostics examine unusual predictor values; measures such as Cook's distance help assess impact on the fitted model. Do not delete a case because a single diagnostic crosses a threshold; investigate it and compare results with and without it. NIST: Regression Diagnostics
Review data in this order before changing it
Preserve the raw data and create a separate flag column. Keep original rows, generated scores, and review status connected instead of overwriting values.
Check the record and collection process. Compare units, decimal or currency conversions, dates and time zones, duplicate rows, code mappings, and sensor or survey errors with source records. Correct only errors you can substantiate.
Compare like conditions. Plot distributions by group, period, or device to see whether a real subgroup or temporary event was mixed into the overall data.
Choose a method for the analysis goal. Explanation, prediction, and process monitoring may call for different criteria. Use plots or fences to find candidates; use a formal test only when its assumptions are reasonable.
Do not automatically discard valid extremes. Retain unexplained but plausible values, and consider robust methods, transformations, or stratification where appropriate. Compare conclusions using the original data and any justified corrections or exclusions.
Report the rule, number of flagged cases, verification findings, reasons for corrections, exclusions or retention, and results from alternative analyses.
The useful question is not “Did this value cross a cutoff?” but “How was it produced, and what does it do to the question I am answering?” A flag starts a review. Removal requires a verified error or an explicit analytical rule, with the reason documented.
References
NIST/SEMATECH: Detection of Outliers
NIST/SEMATECH: Generalized ESD Test for Outliers
NIST/SEMATECH: What are outliers in the data?
NIST Dataplot Reference Manual: Regression Diagnostics
NIST/SEMATECH: Histogram Interpretation—Symmetric with Outlier