| tidypredict_interval {tidypredict} | R Documentation |
It parses a model or uses an already parsed model to return a Tidy Eval formula that can then be used inside a dplyr command.
tidypredict_interval(model, interval = 0.95)
model |
An R model or a tibble with a parsed model. It currently supports lm() models only. |
interval |
The prediction interval, defaults to 0.95 |
The result still has to be added to the fit to obtain the upper bound, and subtracted from fit to obtain the lower bound.
library(dplyr)
df <- mutate(mtcars, cyl = paste0("cyl", cyl))
model <- lm(mpg ~ wt + cyl * disp, offset = am, data = df)
tidypredict_interval(model)