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

ols_plot_resid_regressor

Residual vs regressor 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_plot_resid_regressor(model, variable, print_plot = TRUE)

Arguments

model

An object of class lm.

variable

New predictor to be added to the model.

print_plot

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

Deprecated Function

ols_rvsr_plot() has been deprecated. Instead use ols_plot_resid_regressor().

See Also

[ols_plot_added_variable()], [ols_plot_comp_plus_resid()]

Examples

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

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.