Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: performance
Title: Assessment of Regression Models Performance
Version: 0.15.3.4
Version: 0.15.3.5
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
21 changes: 21 additions & 0 deletions R/check_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
#' time-consuming. By default, `show_dots = NULL`. In this case `check_model()`
#' tries to guess whether performance will be poor due to a very large model
#' and thus automatically shows or hides dots.
#' @param show_ci Logical, if `TRUE`, confidence intervals in plots are shown.
#' For models with only categorical predictors, confidence intervals are not shown
#' by default, because in this case, these are usually on very large scales.
#' @param maximum_dots Limits the number of data points for models with many
#' observations, to reduce the time for rendering the plot. Defaults to a
#' maximum of 2000 data points to render
Expand All @@ -65,7 +68,7 @@
#'
#' @details For Bayesian models from packages **rstanarm** or **brms**,
#' models will be "converted" to their frequentist counterpart, using
#' [`bayestestR::bayesian_as_frequentist`](https://easystats.github.io/bayestestR/reference/convert_bayesian_as_frequentist.html).

Check warning on line 71 in R/check_model.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/check_model.R,line=71,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 130 characters.
#' A more advanced model-check for Bayesian models will be implemented at a
#' later stage.
#'
Expand Down Expand Up @@ -93,7 +96,7 @@
#' plots are helpful to check model assumptions, they do not necessarily indicate
#' so-called "lack of fit", e.g. missed non-linear relationships or interactions.
#' Thus, it is always recommended to also look at
#' [effect plots, including partial residuals](https://strengejacke.github.io/ggeffects/articles/introduction_partial_residuals.html).

Check warning on line 99 in R/check_model.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/check_model.R,line=99,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 134 characters.
#'
#' @section Homogeneity of Variance:
#' This plot checks the assumption of equal variance (homoscedasticity). The
Expand Down Expand Up @@ -206,6 +209,7 @@
type = "density",
residual_type = NULL,
show_dots = NULL,
show_ci = NULL,
maximum_dots = 2000,
size_dot = 2,
size_line = 0.8,
Expand Down Expand Up @@ -278,7 +282,7 @@
insight::format_error(
paste("`check_model()` returned following error:", cleaned_string),
paste0(
"\nIf the error message does not help identifying your problem, another reason why `check_model()` failed might be that models of class `",

Check warning on line 285 in R/check_model.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/check_model.R,line=285,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 147 characters.
class(x)[1],
"` are not yet supported."
) # nolint
Expand Down Expand Up @@ -313,10 +317,20 @@
# tell user about limited dots
if (!is.null(maximum_dots) && !is.null(n) && n > maximum_dots && verbose) {
insight::format_alert(
"The model contains a large number of observations. To ensure efficient rendering, the plot is limited to 2,000 data points. You can use the `maximum_dots` argument to adjust this limit."

Check warning on line 320 in R/check_model.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/check_model.R,line=320,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 193 characters.
)
}

# if we have only categorical predictors, we don't show CI by default
parameter_types <- .safe(parameters::parameters_type(x))
if (
!is.null(parameter_types) && all(parameter_types$Type %in% c("intercept", "factor"))
) {
show_ci = FALSE
} else {
show_ci = TRUE
}

attr(assumptions_data, "panel") <- panel
attr(assumptions_data, "dot_size") <- size_dot
attr(assumptions_data, "line_size") <- size_line
Expand All @@ -327,6 +341,7 @@
attr(assumptions_data, "alpha") <- alpha
attr(assumptions_data, "dot_alpha") <- alpha_dot
attr(assumptions_data, "show_dots") <- isTRUE(show_dots)
attr(assumptions_data, "show_ci") <- isTRUE(show_ci)
attr(assumptions_data, "detrend") <- detrend
attr(assumptions_data, "colors") <- colors
attr(assumptions_data, "theme") <- theme
Expand Down Expand Up @@ -370,6 +385,7 @@
type = "density",
residual_type = NULL,
show_dots = NULL,
show_ci = NULL,
maximum_dots = 2000,
size_dot = 2,
size_line = 0.8,
Expand Down Expand Up @@ -397,6 +413,7 @@
size_axis_title = size_axis_title,
detrend = detrend,
show_dots = show_dots,
show_ci = show_ci,
bandwidth = bandwidth,
type = type,
residual_type = residual_type,
Expand All @@ -421,6 +438,7 @@
type = "density",
residual_type = NULL,
show_dots = NULL,
show_ci = NULL,
maximum_dots = 2000,
size_dot = 2,
size_line = 0.8,
Expand Down Expand Up @@ -448,6 +466,7 @@
base_size = base_size,
detrend = detrend,
show_dots = show_dots,
show_ci = show_ci,
maximum_dots = maximum_dots,
bandwidth = bandwidth,
type = type,
Expand All @@ -468,6 +487,7 @@
type = "density",
residual_type = NULL,
show_dots = NULL,
show_ci = NULL,
maximum_dots = 2000,
size_dot = 2,
size_line = 0.8,
Expand Down Expand Up @@ -495,6 +515,7 @@
base_size = base_size,
detrend = detrend,
show_dots = show_dots,
show_ci = show_ci,
maximum_dots = maximum_dots,
bandwidth = bandwidth,
type = type,
Expand Down
5 changes: 5 additions & 0 deletions man/check_model.Rd

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

Loading