For a project we have to create a time series regression with predictors. Using the
forecast package we managed to run the
tslm() function but the output is not stationary.
# tslm with predictors my.tslm <- tslm(y~ trend + season + x1 + x2 + x3 + x4, data = my.ts)
Hence we tried to do a stepwise regression using
step() to choose a better model but this resulted in an error
stats::step(my.tslm) #Error in `[.default`(x, , jj, drop = FALSE) : #incorrect number of dimensions
Is there a function that allows you to run a stepwise regression on
tslm to select the best predictors or how else could it be done? (We try to avoid dynamic regressions with ARIMA errors for now)
Thank you in advance for any information.