How to Detect Outliers with the Interquartile Range

Finds values that sit far from the rest, using the interquartile range. Anything below Q₁ − 1.5×IQR or above Q₃ + 1.5×IQR counts as an outlier. Unlike a rule built on the mean and standard deviation, the yardstick is not dragged about by the outliers themselves.

This finds values sitting far from the rest, using the interquartile range as the yardstick.

lower=Q11.5×IQR,upper=Q3+1.5×IQR\text{lower} = Q_1 - 1.5 \times IQR, \quad \text{upper} = Q_3 + 1.5 \times IQR

IQRIQR is Q3Q1Q_3 - Q_1, the spread of the middle half of the data. Anything beyond these fences is flagged. The whiskers of a box plot usually reach exactly this far.

Example

For 12, 15, 18, 20, 25, 28, 31, 40, 95, the quartiles are Q1=16.5Q_1 = 16.5 and Q3=35.5Q_3 = 35.5, so IQRIQR is 19. The fences fall at 16.528.5=1216.5 - 28.5 = -12 and 35.5+28.5=6435.5 + 28.5 = 64, and only 95 is flagged.

Why not the mean and standard deviation

A rule of mean ± 3 standard deviations is common, but both the mean and the standard deviation are themselves pulled about by outliers. The presence of 95 inflates the standard deviation enough that 95 can end up inside its own fence. Quartiles depend only on the middle of the data and do not suffer this.

What to do once found

Being an outlier is no licence to discard a value. A mistake in measurement or entry should be corrected, but a genuinely extreme observation may be the most important thing in the data. Check where the value came from before deciding.

Notes

The factor of 1.5 is convention, not the one correct answer. Raising it to 3.0 flags only the more extreme cases.