cr_plots | R Documentation |
Produces component+residual (partial residual) plots for linear models.
cr_plots(x, alpha = 0.4, span = 0.75)
x |
an object of type |
alpha |
numeric; degree of transparency for points (0 to 1, default=0.4) |
span |
numeric; the degree of smoothing for loess lines (default=0.75) |
This function is a modification of the crPlots function
in the car
package, using ggplot2
rather than
base
graphics.
a ggplot2
graph
The linear model can contain factors but not interactions. Plots are based on all predictors, but only the numeric variables are plotted. Each plot has a linear and loess fit line.
crPlot, crPlots
mtcars$am <- factor(mtcars$am) fit <- lm(mpg ~ wt + am + disp + hp, mtcars) cr_plots(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.