Simple linear regression line
Plot to demonstrate that the regression line always passes through mean of the response and predictor variables.
ols_plot_reg_line(response, predictor, print_plot = TRUE)
response
: Response variable.predictor
: Predictor variable.print_plot
: logical; if TRUE
, prints the plot else returns a plot object.ols_plot_reg_line(mtcars$mpg, mtcars$disp)
Useful links