IQR Outlier Fences
Finds: values that sit far outside the bulk of the data.
When to use it: Use it as a first pass in cleaning data, to find values that look like errors or extreme events, such as a price typed with an extra digit. Quartiles ignore extreme values, so one bad point cannot hide itself the way it can in a mean and standard deviation test. A flagged value is a prompt to investigate, not an instruction to delete: real crashes are outliers too.
The formula
In words: IQR = third quartile − first quartile; Lower fence = Q1 − k x IQR; Upper fence = Q3 + k x IQR; values outside the fences are flagged (k = 1.5 is the usual choice)
What each symbol means
| Q_1, Q_3 | 25th and 75th percentiles of the data | same as data |
| IQR | Interquartile range: the spread of the middle half of the data | same as data |
| k | Fence multiplier. 1.5 flags mild outliers, 3 flags extreme ones | number |
Worked example
Fifteen daily values are in the calculator. Which are outliers with k = 1.5?
| First quartile (25th percentile) | 12.50 | |
| Third quartile (75th percentile) | 15.50 | |
| IQR | 15.5 − 12.5 | 3 |
| Lower fence | 12.5 − 1.5 × 3 | 8 |
| Upper fence | 15.5 + 1.5 × 3 | 20 |
| Values outside the fences | 1 | |
| Mean with all values | 19.27 | |
| Mean without the flagged values | 13.86 |
The quartiles are 12.50 and 15.50, so the IQR is 3 and the fences are 8 and 20. 1 value lies outside, the 95. The mean is 19.27 with it and 13.86 without, which shows how much one point can move it.