diagnostics is a generic function for producing regression diagnostics. Currently linear and logistic regression models are supported.

diagnostics(x, ...)

Arguments

x

an object of type "lm" or "glm".

...

further arguments passed to or from other methods.

Value

The results of the methods diagnostics.lm or diagnostics.glm

Details

The diagnostics function produces data visualizations (ggplot2 graphs) for regression diagnostics. The plots depend on the form of the model (lm or glm).

Examples

fit <- lm(mpg ~ hp + wt + accel + origin, data = auto_mpg)
diagnostics(fit)