library(dplyr)
library(lubridate)
# ---- SINGLE SERIES ----
m4_monthly %>%
filter(id == "M750") %>%
plot_time_series_regression(
.date_var = date,
.formula = log(value) ~ as.numeric(date) + month(date, label = TRUE),
.show_summary = TRUE,
.facet_ncol = 2,
.interactive = FALSE
)
# ---- GROUPED SERIES ----
m4_monthly %>%
group_by(id) %>%
plot_time_series_regression(
.date_var = date,
.formula = log(value) ~ as.numeric(date) + month(date, label = TRUE),
.facet_ncol = 2,
.interactive = FALSE
)
Run the code above in your browser using DataLab