Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(dplyr)
- library(magrittr)
- library(lubridate)
- load("~/ecn321/pages/Lectures/ch10data.Rdata")
- estimation_data <- ch10data %>%
- filter(date > as.Date("1967-12-01") & date < as.Date("1994-12-01"))
- estimation_data %<>% mutate(lsales = log(liquor))
- y <- estimation_data$lsales
- time <- 1:length(y)
- seasonal <- as.factor(month(estimation_data$date))
- X <- cbind(time, time2 = time^2, model.matrix(~seasonal - 1))
- reg <- arima(y, order = c(3, 0, 0), xreg = X, include.mean = FALSE)
- summary(reg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement