Calculate the distance of a value from the median of a distribution in relation to its Median Absolute Deviation (MAD)
double_mad_from_median.Rd
This function is suited to find outliers in asymetric distributions (in contrast to the standard mad() function which works for symetric distributions only). The function splits the values along the median and returns the distance for every value from the median, relative to the left or right side MAD. https://eurekastatistics.com/using-the-median-absolute-deviation-to-find-outliers/
Examples
x <- c(1, 2, 3, 3, 4, 4, 4, 5, 5.5, 6, 6, 6.5, 7, 7, 7.5, 8, 9, 12, 52, 90)
double_mad_from_median(x)
#> [1] 2.5000000 2.0000000 1.5000000 1.5000000 1.0000000 1.0000000
#> [7] 1.0000000 0.5000000 0.2500000 0.0000000 0.0000000 0.3333333
#> [13] 0.6666667 0.6666667 1.0000000 1.3333333 2.0000000 4.0000000
#> [19] 30.6666667 56.0000000