Hi.
I work at a fast food chain with around 80 restaurants. We're trying to develop a prediction model for transactions. The database is quite large with over 1.8 million entries. It is data that dates back to 2012 and most importantly it is HOURLY data.
We've seen that the previous weeks at the same day of the week and hour are strong predictors. For example, Friday's transactions at restaurant #1 at 9AM can be predicted by the previous Fridays at restaurant #1 at 9AM.
Since the variable depends on some way on itself, an ARIMA model might be a good fit.
Since I have 80 restaurants over time, it's set up as panel data.
xtset restaurant timeanddate, delta(3600000)
The delta is set up like that because the time variable is set up in milliseconds and 3600000 is the number of milliseconds in an hour.
I need help on setting up the model in STATA.
I've been doing it sort of manually (by creating temporal lagged variables)
For example:
arima y L168.y L336.y L504.y L672.y if restaurant==3
I have to add the if condition because arima doesn't work without panel data.
How would I create an arima model that is only arima y, ar(x) ma(y) if restaurant==3
Also, after estimation I would like to predict the next dates dynamically. (So that it uses the predictions created by the model instead of the actual values)
I'm an Economics major but have not worked previously with STATA.
Thanks so much!
*restaurant==3 was just an example, I need a prediction model for every restaurant.
Also I've done a regular regression and achieved an R2 of around 75%, however I'm looking to try ARIMA to improve accuracy.
I work at a fast food chain with around 80 restaurants. We're trying to develop a prediction model for transactions. The database is quite large with over 1.8 million entries. It is data that dates back to 2012 and most importantly it is HOURLY data.
We've seen that the previous weeks at the same day of the week and hour are strong predictors. For example, Friday's transactions at restaurant #1 at 9AM can be predicted by the previous Fridays at restaurant #1 at 9AM.
Since the variable depends on some way on itself, an ARIMA model might be a good fit.
Since I have 80 restaurants over time, it's set up as panel data.
xtset restaurant timeanddate, delta(3600000)
The delta is set up like that because the time variable is set up in milliseconds and 3600000 is the number of milliseconds in an hour.
I need help on setting up the model in STATA.
I've been doing it sort of manually (by creating temporal lagged variables)
For example:
arima y L168.y L336.y L504.y L672.y if restaurant==3
I have to add the if condition because arima doesn't work without panel data.
How would I create an arima model that is only arima y, ar(x) ma(y) if restaurant==3
Also, after estimation I would like to predict the next dates dynamically. (So that it uses the predictions created by the model instead of the actual values)
I'm an Economics major but have not worked previously with STATA.
Thanks so much!
*restaurant==3 was just an example, I need a prediction model for every restaurant.
Also I've done a regular regression and achieved an R2 of around 75%, however I'm looking to try ARIMA to improve accuracy.
Comment