diff --git a/R/check_model_diagnostics.R b/R/check_model_diagnostics.R index 371e32609..46a64f9c2 100644 --- a/R/check_model_diagnostics.R +++ b/R/check_model_diagnostics.R @@ -174,10 +174,10 @@ if (inherits(model, "lm", which = TRUE) == 1) { cook_levels <- round(stats::qf(0.5, s$fstatistic[2], s$fstatistic[3]), 2) - } else if (!is.null(threshold)) { - cook_levels <- threshold - } else { + } else if (is.null(threshold)) { cook_levels <- c(0.5, 1) + } else { + cook_levels <- threshold } n_params <- tryCatch(model$rank, error = function(e) insight::n_parameters(model))