问题
A quite confusing thing is what I got:
The Median Absolute Deviation output of the following vector is
vec = c( -5.665488 ,3.963051, 14.14956, 0, -5.665488)
> mad(vec)
[1] 8.399653
However, if I compute that I got the following value:
Median absolute deviation = 5.665488
which is equal to the value of the computation I have found online as well: http://www.miniwebtool.com/median-absolute-deviation-calculator/
How can the difference between the calculated value of mine and the website and the value of R be explained?
回答1:
It has to do with the mad function automatically setting the scaling constant as 1.482. If you do
mad(vec, constant=1)
You get the same output as your other methods
来源:https://stackoverflow.com/questions/28506285/median-absolute-deviation-computation-in-r