stepwise regression with time series

forecast
#1

Hi there :blush:

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.

0 Likes

closed #2

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

0 Likes