View source: R/add_intervals.R
add_intervals | R Documentation |
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.
add_intervals(data, fitted_model, SEs = 2)
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) |
dataframe augmented with columns y_pred
, ymin
, and ymax
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.