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.
is , 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.
For 12, 15, 18, 20, 25, 28, 31, 40, 95, the quartiles are and , so is 19. The fences fall at and , and only 95 is flagged.
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.
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.
The factor of 1.5 is convention, not the one correct answer. Raising it to 3.0 flags only the more extreme cases.