Description Usage Arguments Value See Also Examples
Plot model residuals vs. fitted values with ggplot2 to assess a model fit.
1 2 3 | resid_fitted_plot(model, resid_type = "std", outlier_2sd_lines = TRUE,
title = "Residuals vs. Fitted Values", subtitle = TRUE,
xlab = "Fitted Values", ylab = "Residuals", ...)
|
model |
An |
resid_type |
A string indicating which type of residuals to use. The
default |
outlier_2sd_lines |
A logical indicating whether to draw horizontal red lines on the standardized residual plot at a y-value of +/- 2. |
title |
A string indicating what to title the plot. |
subtitle |
A logical indicating whether to include the default subtitle. |
xlab |
A string indicating what to label the x-axis. |
ylab |
A string indicating what to label the y-axis. |
... |
Additional arguments passed to
|
If a single plot type ("std"
or "unstd"
) is specified,
a ggplot2 plot object is returned. If "both"
plot types are
requested, a call to gridExtra::grid.arrange
draws
on the current device and a gtable is returned.
resid_hist_qq
for residual histograms and Q-Q plots.
1 2 3 4 | mtcars_lm <- lm(mpg ~ wt, mtcars)
resid_fitted_plot(mtcars_lm)
resid_fitted_plot(mtcars_lm, resid_type = "unstd")
resid_fitted_plot(mtcars_lm, resid_type = "both")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.