lb_plot_lm_bands: Plot linear model fitted values with confidence bands

View source: R/lb_plot_lm_bands.R

lb_plot_lm_bandsR Documentation

Plot linear model fitted values with confidence bands

Description

Creates a plot object of a fitted linear model with confidence bands and a loess smoother

Usage

lb_plot_lm_bands(df, x, y, band_type = "whbands", level = 0.95)

Arguments

df

a data frame to be modeled

x

a character name of an explanatory variable from the data frame

y

a character name of a response variable from the data frame

band_type

A character value for the type of confidence band. Includes "whbands".

level

a number between 0 and 1 for the confidence level of the bands

Value

a ggplot2 object with the fitted line, the confidence bands and a loess smoother

Examples

lb_plot_lm_bands(mtcars, "disp", "mpg")

rressler/lbutils documentation built on Oct. 23, 2022, 11:20 p.m.