\[ Y = \beta_0 + \beta_1Time + \beta_2After + \beta_3Time\times After \]
with \(\beta_2\) as the event study estimate
What do we have?
library(tsibble); library(fable)
tbts <- as_tsibble(tb, index = Time)
# Pretend we don't know the order and try up to AR(3) with trend
m <- tbts %>%
filter(!After) %>%
model(AR(Y ~ Time + I(Time^2) + order(1)))
predictions <- forecast(m, newdata = tbts %>% filter(!After), h = 20)
effect <- mean(tbts %>% filter(After) %>% pull(Y)) - mean(predictions$.mean)
effect
## [1] 4.002421
## Agrawal and Kamakura
However!