Outlier meaning
An outlier is a value that sits unusually far from the rest of a data set. In test scores of 72, 75, 78, 80, 81 and 12, the 12 stands out at once. Outliers can come from mistakes (a misplaced decimal, a mis-typed entry), from a different group sneaking into the data (one adult in a sample of children's heights), or from genuine rare events (a record-breaking heatwave).
There is no single universal definition. "Far" has to be measured against something, so statisticians use rules based on the spread of the data. The two used most in school and in everyday analysis are the IQR rule and the z-score rule.
The 1.5 × IQR rule
- Put the data in order.
- Find the median, then the medians of the lower and upper halves. These are Q1 and Q3.
- Compute the interquartile range: IQR = Q3 − Q1.
- Build the fences: lower = Q1 − 1.5 × IQR, upper = Q3 + 1.5 × IQR.
- Any value outside the fences is an outlier.
Worked example. Daily commute times in minutes: 12, 14, 15, 15, 16, 17, 18, 19, 21, 48.
- Lower half 12, 14, 15, 15, 16 → Q1 = 15
- Upper half 17, 18, 19, 21, 48 → Q3 = 19
- IQR = 19 − 15 = 4
- Fences: 15 − 6 = 9 and 19 + 6 = 25
- 48 is above 25, so it is an outlier. Nothing is below 9.
Software may use a slightly different quartile method and get Q1 and Q3 a little different, but a value as far out as 48 is flagged by every version. On a box plot, outliers are drawn as separate dots beyond the whiskers.
The z-score rule
For data that is roughly bell-shaped, a z-score measures how many standard deviations a value is from the mean:
A common cutoff is |z| > 3, sometimes |z| > 2 for small samples. If exam scores have a mean of 70 and a standard deviation of 8, a score of 98 has z = (98 − 70) ÷ 8 = 3.5 and would be flagged. The weakness of this rule is that the outlier itself inflates the mean and standard deviation, which can hide it in small data sets. The IQR rule does not have that problem.
How outliers change the summary statistics
Using the commute data above:
| Statistic | With 48 | Without 48 |
|---|---|---|
| Mean | 19.5 min | 16.3 min |
| Median | 16.5 min | 16 min |
| Range | 36 min | 9 min |
The mean jumps by over 3 minutes because of one value; the median moves by half a minute. Range is the most sensitive of all, since it depends only on the extremes. The mode is not affected at all here. This is why house prices and household incomes are usually reported as medians.
What to do with an outlier
- Check it first. Look for data entry errors, wrong units or equipment faults. A height recorded as 1,750 cm is almost certainly 175.0 cm.
- Correct or remove genuine errors, and note that you did.
- Keep real values. A real extreme is part of the story. A hospital's unusually long wait time may be the most important number in the report.
- Use robust statistics. Median and IQR summarise data well even with outliers present.
- Report both versions when a result depends heavily on one or two points.
Outliers in graphs and models
On a scatter plot, an outlier is a point far from the overall pattern. A single point can drag a line of best fit toward it, especially if it lies far to the left or right; such points are called influential. Fitting the line with and without the point shows how much it matters.
In machine learning and fraud detection, finding outliers is often the goal rather than a nuisance. A card transaction far outside a customer's normal pattern is an outlier worth a second look.
Common mistakes
- Calling the maximum an outlier automatically. It has to fail a rule, not just be the largest.
- Deleting values because they are inconvenient. That biases the results.
- Using the z-score rule on tiny or skewed samples, where it is unreliable.
- Forgetting to sort the data before finding quartiles.
The standard deviation calculator gives the mean and spread you need for z-scores, and mean, median and mode explained shows when each average is the better choice.