Description Usage Arguments Value Examples
This plots estmated value vs observed for a given time series. It also visualized upper and lower level for that estimate.
1 | plotPrediction(preddf)
|
preddf |
the prediction data to plot |
a ggplot object
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(ggplot2)
library(dplyr)
data(economics)
myfit <- lm(unemploy ~ pop + psavert, data = economics)
preddf <- predict(myfit, interval = "predict") %>% as_tibble()
preddf <- preddf %>% transmute(
date = as.Date(economics$date),
observed = economics$unemploy,
estimate = fit,
lower = lwr,
upper = upr
)
plotPrediction(preddf)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.