pred_interval_reg: Plot prediction intervals for simple linear regression

View source: R/regression.R

pred_interval_regR Documentation

Plot prediction intervals for simple linear regression

Description

Plot prediction intervals for simple linear regression

Usage

pred_interval_reg(
  lmobject,
  conf_int_line = T,
  pred_interval = T,
  level = 0.95,
  ngrid = 100
)

Arguments

lmobject

a fitted regression model from lm.

conf_int_line

if TRUE, then conf intervals for regression line are plotted.

pred_interval

if TRUE, then prediction intervals are plotted.

level

confidence level, default is level = 0.95

ngrid

number of grid points over which the intervals are computed

Value

data frame with confidence and prediction intervals over xGrid

Examples

library(regkurs)
lmfit = lm(mpg ~ hp, data = mtcars)
res = pred_interval_reg(lmfit)

StatisticsSU/regkurs documentation built on Jan. 29, 2023, 4:54 p.m.