Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ols_plot_resid_fit

Residual vs fitted plot


Description

Scatter plot of residuals on the y axis and fitted values on the x axis to detect non-linearity, unequal error variances, and outliers.

Usage

ols_plot_resid_fit(model, print_plot = TRUE)

Arguments

model

An object of class lm.

print_plot

logical; if TRUE, prints the plot else returns a plot object.

Details

Characteristics of a well behaved residual vs fitted plot:

  • The residuals spread randomly around the 0 line indicating that the relationship is linear.

  • The residuals form an approximate horizontal band around the 0 line indicating homogeneity of error variance.

  • No one residual is visibly away from the random pattern of the residuals indicating that there are no outliers.

Deprecated Function

ols_rvsp_plot() has been deprecated. Instead use ols_plot_resid_fit().

See Also

Examples

model <- lm(mpg ~ disp + hp + wt, data = mtcars)
ols_plot_resid_fit(model)

olsrr

Tools for Building OLS Regression Models

v0.5.3
MIT + file LICENSE
Authors
Aravind Hebbali [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.