add_intervals: Add a model predictions and SE band to a data.frame

View source: R/add_intervals.R

add_intervalsR Documentation

Add a model predictions and SE band to a data.frame

Description

Adds columns y_pred, ymax and ymin to a data.frame based on predictions from a previously fitted linear model (lm or lmer). Note: lmer models don't provide SEs, so those values are set to NA.

Usage

add_intervals(data, fitted_model, SEs = 2)

Arguments

data

A data.frame object with all terms used in the model

fitted_model

a model object (ex from lm or lmer) compatible with the 'predict' function

SEs

width of confidence interval band (in se's)

Value

dataframe augmented with columns y_pred, ymin, and ymax


deruncie/PLS205_package documentation built on March 25, 2022, 2:29 a.m.