Residual vs fitted plot
Scatter plot of residuals on the y axis and fitted values on the x axis to detect non-linearity, unequal error variances, and outliers.
ols_plot_resid_fit(model, print_plot = TRUE)
model
: An object of class lm
.print_plot
: logical; if TRUE
, prints the plot else returns a plot object.Characteristics of a well behaved residual vs fitted plot:
model <- lm(mpg ~ disp + hp + wt, data = mtcars) ols_plot_resid_fit(model)
Other residual diagnostics: ols_plot_resid_box()
, ols_plot_resid_hist()
, ols_plot_resid_qq()
, ols_test_correlation()
, ols_test_normality()
Useful links