The plot() method for the performance::check_model() function.
Diagnostic plots for regression models.
Arguments
- x
An object.
- theme
A ggplot2-theme function, e.g.
theme = theme_lucid()ortheme = ggplot2::theme_dark().- colors
Character vector of length two, indicating the colors (in hex-format) for points and line.
- type
Plot type for the posterior predictive checks plot. Can be
"density"(default),"discrete_dots","discrete_interval"or"discrete_both"(thediscrete_*options are appropriate for models with discrete - binary, integer or ordinal etc. - outcomes).- n_columns
Number of columns to align plots.
- show_smooth
Logical, if
FALSE, no trend line is drawn in the Linearity, Homogeneity of Variance and Influential Observations panels. This turns off the LOESS smoother and, for models whose fitted values take only a few distinct values, the cell means with their line and error bars. IfNULL(default), the value stored in thecheck_model()object is used, andTRUEif there is none. The binned residuals panel is not affected.- ...
Arguments passed to or from other methods.
Details
Larger models (with many observations) may take a longer time to render.
Thus, the number of data points is limited to 2000 by default. Use
plot(check_model(), maximum_dots = <number>) (or
check_model(maximum_dots = <number>)) to define the number of data points
that should be shown in the plots.
See also
See also the vignette about
check_model().
Examples
if (FALSE) { # require("patchwork") && FALSE
library(performance)
model <- lm(qsec ~ drat + wt, data = mtcars)
plot(check_model(model))
}
