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

ols_plot_obs_fit

Observed vs fitted values plot


Description

Plot of observed vs fitted values to assess the fit of the model.

Usage

ols_plot_obs_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

Ideally, all your points should be close to a regressed diagonal line. Draw such a diagonal line within your graph and check out where the points lie. If your model had a high R Square, all the points would be close to this diagonal line. The lower the R Square, the weaker the Goodness of fit of your model, the more foggy or dispersed your points are from this diagonal line.

Deprecated Function

ols_ovsp_plot() has been deprecated. Instead use ols_plot_obs_fit().

Examples

model <- lm(mpg ~ disp + hp + wt, data = mtcars)
ols_plot_obs_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.