Is there a way to forecast a time series multiple linear regression using externally made dummy variables?
This question concerns question 4h of this textbook exercise. It asks to make future predictions based on a chosen TSLM model which involves an endogenously (if i'm using this right) made dummy variable based off certain time points. My main code is as follows
The main problem I've encountered is that when I use forecast() on my model, it gives an error message:
This is very confusing because shouldn't my modified data already include the dummy variables? Hence, the model includes it and should be able to forecast the data. Yet it doesn't. Is there something I'm not doing?
Topic dummy-variables forecasting linear-regression time-series r
Category Data Science