I hope the title makes sense. Basically, I have been working on data for a while and I'd like to forecast future values and plot them. My regression mode is this: lm(Total~ Rank+ Market), when I do regression analysis I can see the coefficients and everything. My data has the following columns: total, market, rank, date. But with forecasting function I believe the regression model did not work. I tried converting Total into a time-series and plotting it but in that case, the other dependent variables have no effect on the total value.
I have been trying to figure this out for a while and I looked into a lot of forecasting methods but they only include one variable, not the regression model itself. Can you please provide any resources or syntax of how to forecast my multivariable regression model?
https://rpubs.com/Mentors_Ubiqum/tslm
I thought this was what I'm looking for but they did not include the other variables in the function and I tried my model with tslm but it didn't work. I think tslm can be only forecasted with trend and season variables?
Thank you in advance
edit:
So far what I have tried :
ts <- ts(originalfile$Total, frequency = 365, start decimal_date(as.Date("2020-08-01")))
ts_dataframe <- (Total = ts, originalfile$market, originalfile$rank)
mymodel <- tslm(Total ~ Rank +Market, ts_dataframe)
and then I tried to plot mymodel with auto.arima and with forecast. Auto arima did not work nad forecast worked but graph looks weird visually there are no lines just a straight line in a rectangle. I cannot share the picture it's on my work laptop but what seems to be wrong here?