diff --git a/NEWS.md b/NEWS.md index 5475776cc..a4fd3df0f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -23,6 +23,8 @@ * `performance_score()` should no longer fail for models where scoring rules can't be calculated. Instead, an informative message is returned. +* `check_outliers()` now properly accept the `percentage_central` argument when using the `"mcd"` method. + # performance 0.10.8 ## Changes diff --git a/R/check_outliers.R b/R/check_outliers.R index 2a1d185d3..e01b20e12 100644 --- a/R/check_outliers.R +++ b/R/check_outliers.R @@ -160,6 +160,9 @@ #' the data (by default, 66\%), before computing the Mahalanobis Distance. This #' is deemed to be a more robust method of identifying and removing outliers #' than regular Mahalanobis distance. +#' This method has a `percentage_central` argument that allows specifying +#' the breakdown point (0.75, the default, is recommended by Leys et al. 2018, +#' but a commonly used alternative is 0.50). #' #' - **Invariant Coordinate Selection (ICS)**: #' The outlier are detected using ICS, which by default uses an alpha threshold @@ -1098,8 +1101,8 @@ check_outliers.data.frame <- function(x, out <- c(out, .check_outliers_mcd( x, threshold = thresholds$mcd, - percentage_central = 0.66, - ID.names = ID.names + ID.names = ID.names, + ... )) count.table <- datawizard::data_filter( @@ -1726,7 +1729,7 @@ check_outliers.metabin <- check_outliers.metagen .check_outliers_mcd <- function(x, threshold = stats::qchisq(p = 1 - 0.001, df = ncol(x)), - percentage_central = 0.50, + percentage_central = 0.75, ID.names = NULL) { out <- data.frame(Row = seq_len(nrow(x))) diff --git a/man/check_outliers.Rd b/man/check_outliers.Rd index 74c992b6f..9c2a046b4 100644 --- a/man/check_outliers.Rd +++ b/man/check_outliers.Rd @@ -189,6 +189,9 @@ calculates the mean and covariance matrix based on the most central subset of the data (by default, 66\\%), before computing the Mahalanobis Distance. This is deemed to be a more robust method of identifying and removing outliers than regular Mahalanobis distance. +This method has a \code{percentage_central} argument that allows specifying +the breakdown point (0.75, the default, is recommended by Leys et al. 2018, +but a commonly used alternative is 0.50). \item \strong{Invariant Coordinate Selection (ICS)}: The outlier are detected using ICS, which by default uses an alpha threshold of 0.025 (corresponding to the 2.5\\% most extreme observations) as a cut-off