View source: R/data_preprocessing.R
detect_outliers_mad | R Documentation |
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)
data |
Numeric vector of values to analyze |
k |
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.
A list containing:
outlier_mask |
Logical vector indicating outliers |
stats |
List containing:
|
#' @importFrom stats median mad
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.