gg_resleverage: Plot residual versus leverage plot in ggplot.

View source: R/gg_resleverage.R

gg_resleverageR Documentation

Plot residual versus leverage plot in ggplot.

Description

Plot residual versus leverage plot in ggplot.

Usage

gg_resleverage(fitted.lm, method = "loess", se = FALSE, scale.factor = 1)

Arguments

fitted.lm

a fitted linear model (i.e. lm, glm) that contains fitted regression

method

smoothing method of fitted line on scale-location plot. eg. "lm", "glm", "gam", "loess", "rlm". See https://ggplot2.tidyverse.org/reference/geom_smooth.html for more details.

se

logical; determines whether se belt should be plotted on plot

scale.factor

numeric; scales the point size and linewidth to allow customized viewing. Defaults to 1.

Value

A ggplot object that contains residual vs. leverage graph

Examples

library(MASS)
data(Cars93)
cars_lm <- lm(Price ~ Passengers + Length + RPM, data = Cars93)
gg_resleverage(cars_lm)

lindia documentation built on Aug. 11, 2023, 1:09 a.m.