Learn R Programming

olsrr (version 0.4.0)

ols_rvsr_plot: Residual vs Regressors Plot

Description

Graph to determine whether we should add a new predictor to the model already containing other predictors. The residuals from the model is regressed on the new predictor and if the plot shows non random pattern, you should consider adding the new predictor to the model.

Usage

ols_rvsr_plot(model, variable)

Arguments

model

an object of class lm

variable

new predictor to be added to the model

Examples

Run this code
# NOT RUN {
model <- lm(mpg ~ disp + hp + wt, data = mtcars)
ols_rvsr_plot(model, mtcars$drat)
# }

Run the code above in your browser using DataLab