Detects outliers in numeric data using the Median Absolute Deviation (MAD) method. This robust method is less sensitive to extreme values than standard deviation and works well for non-normally distributed data.
detect_outliers_mad(data, k = 3)
A list containing:
Logical vector indicating outliers
List containing:
median: Median of data
mad: Median absolute deviation
n_outliers: Number of outliers detected
#' @importFrom stats median mad
Numeric vector of values to analyze
Numeric threshold for outlier detection (default: 3).
The function calculates the median and MAD of the data and identifies points
that are more than k
MADs from the median as outliers.