View source: R/winsorize_mad.R
winsorize_mad | R Documentation |
Winsorize (bring extreme observations to usually +/- 3 standard deviations) data based on median absolute deviations instead of standard deviations.
winsorize_mad(x, criteria = 3)
x |
The vector to be winsorized based on the MAD. |
criteria |
How many MAD to use as threshold (similar to standard deviations) |
For the easystats equivalent, use:
datawizard::winsorize(x, method = "zscore", threshold = 3, robust = TRUE)
.
A numeric vector of winsorized data.
Leys, C., Ley, C., Klein, O., Bernard, P., & Licata, L. (2013). Detecting outliers: Do not use standard deviation around the mean, use absolute deviation around the median. Journal of Experimental Social Psychology, 49(4), 764–766. https://doi.org/10.1016/j.jesp.2013.03.013
winsorize_mad(mtcars$qsec, criteria = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.