spread_plot | R Documentation |
Creates a plot for examining the possible dependence of spread on level using the studentized residuals from a linear model.
spread_plot(x, alpha = 0.4, n.labels = 0, span = 0.75)
x |
an object of class |
alpha |
numeric; degree of transparency for points (0 to 1, default=0.4). |
n.labels |
integer; the number of largest residuals to label (default=0). |
span |
numeric; smoothing parameter for loess fit line (default=0.75) |
This function is a modification of the spreadLevelPlot function
in the car
package, using ggplot2
rather than
base
graphics.
a ggplot2
graph
The graph plots the fitted values against the absolute studentized residuals on logarithmic scales. A robust linear fit line and a loess fit line are also plotted.
spreadLevelPlot, rlm
mtcars$am <- factor(mtcars$am) fit <- lm(mpg ~ wt + am + disp + hp, mtcars) spread_plot(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.