Skip to content

Density plot of residuals

Source: R/plotDiagnostics.R ยท Help: ?plotResidualDensity

Shows the distribution of residuals with a kernel density estimate.

Usage

plotResidualDensity(model)

Arguments

model
A fitted model of class lm or glm.

Value

A ggplot object.

Examples

data(mtcars)
m <- lm(mpg ~ wt + qsec, data = mtcars)
plotResidualDensity(m)