powered by
Plot scale-location (also called spread-location plot) in ggplot.
gg_scalelocation(fitted.lm, method = "loess", scale.factor = 1, se = FALSE)
A ggplot object that contains scale-location graph
a fitted linear model (i.e. lm, glm) that contains fitted regression
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.
numeric; scales the point size and linewidth to allow customized viewing. Defaults to 1.
logical; determines whether se belt should be plotted on plot
library(MASS) data(Cars93) cars_lm <- lm(Price ~ Passengers + Length + RPM, data = Cars93) gg_scalelocation(cars_lm)
Run the code above in your browser using DataLab