Compute the mean absolute deviation about the mean

ds_mdev(x, na.rm = FALSE)

Arguments

x

a numeric vector

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Value

Mean absolute deviation of x

Details

The stat_mdev function computes the mean absolute deviation about the mean. It is different from mad in stats package as the statistic used to compute the deviations is not median but mean. Any NA values are stripped from x before computation takes place

Deprecated Function

stat_mdev() has been deprecated. Instead use ds_mdev().

See also

mad

Examples

ds_mdev(mtcars$mpg)
#> [1] 4.714453