11.2.2 Absolute deviation

absdev( data)
Compute the absolute deviation from the mean of data The absolute deviation from the mean is defined as

$\displaystyle absdev = (1/N) \sum \vert x_i - \hat\mu\vert$ (11.5)

where $ x_i$ are the elements of the dataset data. The absolute deviation from the mean provides a more robust measure of the width of a distribution than the variance. This function computes the mean of data via a call to mean.

absdev_m( data, mean)
Compute the absolute deviation of the dataset data relative to the given value of mean

$\displaystyle absdev = (1/N) \sum \vert x_i - mean\vert$ (11.6)

This function is useful if you have already computed the mean of data (and want to avoid recomputing it), or wish to calculate the absolute deviation relative to another value (such as zero, or the median).