6
$\begingroup$

Suppose my data look like the following:

(10, 10, 10, 10, 10, 0)

Would it be possible to remove an outlier in this distribution using the median absolute deviation?

Of course, you wouldn't need to worry about outliers in a dataset like that, but how would you use the MAD to detect outliers in a similar dataset, when the MAD value equals 0?

$\endgroup$
6
  • 8
    $\begingroup$ What would it mean to have an outlier in a dataset where the MAD was 0? If there were an outlier, what difference would it make? $\endgroup$ Commented Dec 9, 2015 at 12:24
  • 1
    $\begingroup$ If you want to detect outliers then it's probably best not to use a measure that ignores them. $\endgroup$
    – dsaxton
    Commented Dec 9, 2015 at 14:11
  • 6
    $\begingroup$ @dsaxton: actually it is the opposite. If you want to detect the outliers, you have to use a measure that is not liable to being swayed by them. The reference are too numerous to cite here but you could start with C. Becker and U. Gather (1999). The Masking Breakdown Point of Multivariate Outlier Identification Rules.. $\endgroup$
    – user603
    Commented Dec 21, 2015 at 1:54
  • $\begingroup$ I'm familiar with the point you're making, and my comment may have been misleading. The poster seemed to be suggesting he could use median absolute deviation alone to detect outliers (that is, see if removing a point caused it to go down). This wouldn't work because the median absolute deviation wouldn't change as a result of removing an outlier. $\endgroup$
    – dsaxton
    Commented Dec 21, 2015 at 6:00
  • $\begingroup$ Take a look at: this post There is a section about the MAD=0 problem. $\endgroup$
    – Gilberto
    Commented Sep 30, 2016 at 8:24

2 Answers 2

1
$\begingroup$

There is no unique true definition of what an outlier actually is, and in practice how to deal with outliers and how to identify them should always depend on the meaning of the data (i.e., are there reasons to think that outliers are "erroneous" or on the other hand informative and important?), what is done with the information that a certain observation is an outlier, particularly what methods to apply next after potential "outlier treatment", removal or other. Note that it is not mandatory and in fact often bad to remove outliers, as these may be valid observations that hold important information!

Identifying outliers based on MAD and median comes with an implicit definition what an outlier is. If the majority of observations is distributed around a center, an outlier is an observation that is far from that center, and "far" is defined to be relative to the variation of the majority around the center. In the given example, the variation of 5 out of 6 observations is zero, and the sixth observation is very far (in fact infinitely far) away from these in relation to that variation (zero, measured by MAD, but if we're talking just about the variation of the majority, you'd also get zero with the standard sample variance). So according to the underlying outlier concept of median/MAD, the sixth observation is an outlier for sure, and this would still be so if you'd assume that the majority of data is normally distributed with a certain variance and you'd estimate that variance with the sample variance. And in fact it's not just a majority, it's 5/6 of the observations. The boxplot outlier identification based on IQR would agree with this.

But this is a formal definition that doesn't take into account what may be relevant in practice. In particular in practice data may not be continuously distributed and for some reason, even though the true variance is not zero, may often bring up the same value of 10. In this case arguably outlier identification based on MAD (and also on the variance of the majority) may not be appropriate because observations that are not 10 may be perfectly fine. It may however also be that 1, 2, or 3 are perfectly fine whereas 10 isn't, but realise that this cannot be identified from the given data! There is no information in the data about how far away from 10 values are still acceptable, as any value that isn't 10 is, based on the majority variation of 0 infinitely far away (regardless of how you measure it)!

This means that either you can accept the outlier concept of MAD (which here is in line with the boxplot concept and actually any concept that is based on assuming normality for a majority of the data) and treat the 0 as outlier, or you need to concede that the data don't contain enough information about non-outlier variation so that you cannot say whether or not 0 in fact is an outlier. Which brings you back to the meaning of the data and the implications of declaring an observation outlier in the situation of interest. The message is that any alternative method in this specific situation would not have a better basis for outlier detection.

By the way, the MAD outlier concept defines outliers relative to the most central majority of observations and may identify up to 50% outliers. This is in several applications a too large number, and one may want regularly treat a larger percentage of observations as non-outliers. However, this is not really the problem here, as in fact it's 5/6 of the observations that are "central".

$\endgroup$
2
  • 2
    $\begingroup$ (+1) Great answer. but I just want to comment on one detail. Box plots come in different flavours but in my reading the most common flavour uses the rule of thumb from J.W. Tukey that points are plotted individually if and only if they lie more than 1.5 IQR away from the nearer quartile. In this case the IQR is 0 and so indeed 0 as a data point is, or should be, plotted separately while the rest of the display (maximum, median and quartiles) collapses to a degenerate box at 10. That is all logical enough, but it seems likely (to judge from posts here) that it would puzzle many users. $\endgroup$
    – Nick Cox
    Commented Nov 20 at 15:38
  • $\begingroup$ You're not stating or implying otherwise, so I am just expanding on that detail. $\endgroup$
    – Nick Cox
    Commented Nov 20 at 15:38
0
$\begingroup$

For me, it worked to use MAE (Mean Absolute Error) when MAD is zero.

For your example, MAE would be 1.666667. It is not a number similar to most of the numbers (the mode), but it is greater than 0 so you can still use it with a threshold value, as I did. Another option could be to use the mean (8.333 for your example).

Based in this other answer: https://stats.stackexchange.com/a/339949/406965.

$\endgroup$
1
  • $\begingroup$ The problem is that if indeed an outlying observation is erroneous (read or typed in wrongly or something), you don't want outlier identification to depend on that value. The suspicion that such values are erroneous is a major reason to look for outliers in the first place. Outlier identification based on the median and MAD will not depend on the 0, and if the 0 is indeed unreliable, that is a good thing! $\endgroup$ Commented Nov 20 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.