Learn R Programming

olsrr (version 0.1.0)

ols_rvsp_plot: Residual vs Fitted Plot

Description

It is a 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_rvsp_plot(model)

Arguments

model

an object of class lm 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.

Examples

Run this code
model <- lm(mpg ~ disp + hp + wt, data = mtcars)
ols_rvsp_plot(model)

Run the code above in your browser using DataLab