problem-2.22

problem-2.22  The function mad() returns the median deviation from the median. It is a measure of variation similar to the mean-squared distance from the mean (basically the variance) but more robust. For the long-tailed exec.pay data set we see that the standard deviation is very skewed by the outliers:
> attach(exec.pay)
> mad(exec.pay)
[1] 20.76
> IQR(exec.pay)
[1] 27.5
> sd(exec.pay)                  # skewed
[1] 207.0