residual_plots: Residual Plots for Linear Models

View source: R/residual_plots.R

residual_plotsR Documentation

Residual Plots for Linear Models

Description

Residual Plots for Linear Models

Usage

residual_plots(model, type = "b")

Arguments

model

Logical indicating whether the model-level partitioning (TRUE) or term-level partitioning (FALSE; default) should be used

type

Character string indicating the type of residual plot to return. The default is type="b" (both). You can also use type="d" (density) or type="s" (scatterplot).

Value

One or more plots of the standardized residuals. In the density plot, a confidence envelope of reasonable values based on the normality assumption being true is produced along with the empirical density of the residuals. In the scatterplot of the standardized residuals versus the fitted values, a confidence envelope of reasonable values based on the mean residual = 0 (linearity) is produced along with the loess smoother based on the empirical data.

Examples

lm.1 = lm(mpg ~ 1 + hp + wt, data = mtcars)
residual_plots(lm.1, type = "b")


zief0002/educate documentation built on July 27, 2023, 9:25 a.m.