[R] Double MAD with R

varin sacha v@r|n@@ch@ @end|ng |rom y@hoo@|r
Mon Aug 3 16:22:21 CEST 2020


Dear R-Experts,

Is there an all-ready function to calculate the Double MAD (Median absolute deviation) as there is an easy function to calculate the MAD "mad function". Or I have to write my own function for Double MAD ?

To calculate the double MAD, the idea is the following : for the obtained median value, we should calculate two median absolution deviations. One deviation should be calculated for the numbers below the median and one for the numbers above the median:

Here is the very easy reproducible example :

x<-c(2.5,4.4,3.2,2.1,1.3,2.6,5,6.6,5,5,6.1,7.2,9.4,6.9)
mad(x)



More information about the R-help mailing list