Skip to content

Commit

Permalink
fix problem with percentage_central argument in check_outliers with m…
Browse files Browse the repository at this point in the history
…cd method
  • Loading branch information
rempsyc committed Jan 24, 2024
1 parent eac5e98 commit 605f9e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions R/check_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)))

Expand Down
3 changes: 3 additions & 0 deletions man/check_outliers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 605f9e3

Please sign in to comment.