weighted.mad | R Documentation |
Computes the weighted median absolute deviation to median (aka MAD) of a distribution.
weighted.mad(x, weights = NULL, na.rm = FALSE)
x |
numeric vector |
weights |
numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used. |
na.rm |
logical, indicating whether NA values should be silently removed before the computation proceeds. Default is FALSE. |
a length-one numeric vector
Nicolas Robette
weighted.quantile
data(Movies)
weighted.mad(Movies$Critics, weights = rep(c(.8,1.2), 500))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.