Learn R Programming

performance (version 0.2.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, ...)

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.

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