Learn R Programming

performance (version 0.3.0)

check_model: Visual check of model assumptions

Description

Visual check of model various assumptions (normality of residuals, normality of random effects, heteroscedasticity, homogeneity of variance, multicollinearity).

Usage

check_model(x, ...)

# S3 method for default check_model(x, dot_size = 2, line_size = 0.8, panel = TRUE, check = "all", ...)

Arguments

x

A model object.

...

Currently not used.

dot_size

Size of dot-geoms.

line_size

Size of line-geoms.

panel

Logical, if TRUE, plots are arranged as panels; else, single plots for each diagnostic are returned.

check

Character vector, indicating which checks for should be performed and plotted. May be one or more of "all", "vif", "qq", "normality", "ncv", "homogeneity", "outliers", "reqq". "reqq" is a QQ-plot for random effects and only available for mixed models. "ncv" checks for non-constant variance, i.e. for heteroscedasticity. By default, all possible checks are performed and plotted.

Value

The data frame that is used for plotting.

Examples

Run this code
# NOT RUN {
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
check_model(m)

library(lme4)
m <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
check_model(m, panel = FALSE)

library(rstanarm)
m <- stan_glm(mpg ~ wt + gear, data = mtcars, chains = 2, iter = 200)
check_model(m)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab