Learn R Programming

insight (version 0.18.6)

get_residuals: Extract model residuals

Description

Returns the residuals from regression models.

Usage

get_residuals(x, ...)

# S3 method for default get_residuals(x, weighted = FALSE, verbose = TRUE, ...)

Value

The residuals, or NULL if this information could not be accessed.

Arguments

x

A model.

...

Passed down to residuals(), if possible.

weighted

Logical, if TRUE, returns weighted residuals.

verbose

Toggle warnings and messages.

Examples

Run this code
data(mtcars)
m <- lm(mpg ~ wt + cyl + vs, data = mtcars)
get_residuals(m)

m <- glm(vs ~ wt + cyl + mpg, data = mtcars, family = binomial())
get_residuals(m) # type = "deviance" by default
get_residuals(m, type = "response")

Run the code above in your browser using DataLab