Perform Winsorization on a Vector Based on Median Absolute Deviation (MAD)
Source:R/get_winsorization.R
get_winsorization.Rd
This function performs winsorization on a given vector x
based on
the median absolute deviation (MAD). It replaces extreme values (those beyond
criteria
number of MADs from the median) with the highest/lowest non-extreme value.
If there are no outliers in the vector based on the MAD criterion, the function
returns NULL and prints a message to the console.
Arguments
- x
A numeric vector to winsorize.
- criteria
The number of MADs from the median beyond which values are considered outliers. Defaults to 3.