lb_plot_lm_bandsf: Plot linear model fitted values with confidence bands based...

View source: R/lb_plot_lm_bands.R

lb_plot_lm_bandsfR Documentation

Plot linear model fitted values with confidence bands based on a formula

Description

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

Usage

lb_plot_lm_bandsf(
  formula,
  data,
  band_type = "whbands",
  level = 0.95,
  smoother = "None"
)

Arguments

formula

a formula object to be fit by a linear model

data

a data frame with the variables in the formula

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

smoother

any of the accepted methods for the ggplot2::geom_smooth() should be in quotes unless the desired option is NULL

Value

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

Examples

lb_plot_lm_bandsf(mpg ~ wt, data = mtcars)

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