Skip to contents

Creates a scatter plot with linear regression line and displays model statistics (R², intercept, slope, and p-value) in the title.

Usage

ggplotRegression(fit)

Arguments

fit

A linear model object created with lm()

Value

A ggplot2 plot object

Examples

if (FALSE) { # \dontrun{
model <- lm(mpg ~ wt, data = mtcars)
ggplotRegression(model)
} # }