- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello again. I would like to do forecast with regression model.
I use this source code but the result won't come out and I don't know what could be wrong.
proc reg data = armaxvlp;
model Bill = Time DL1 DL2 DL3 D1 D2 D3 D4 D5 D6 Mt/noint;
output out = Res R = Bill_Res;
run;
forecast out = ramalan lead = 12;
run;
proc print data = ramalan (obs = 48);
run;
Thankyou.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you are fitting a regression on a monthly data set, from 2016 to 2018, and now you want forecasts for 2019, you can get predicted values for 2019 but you need to have all the values of the x-variables in the regression present, plus Waktu must be months in 2019.
In other words, all the variables in
model Bill = Waktu DL1 DL2 DL3 D1 D2 D3 D4 D5 D6 Mt/noint;
except for the y-variable BILL must be present (not missing). Then you can get predicted values from the output statement.
output out = Res R = Bill_Res p=bill_pred;
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@sasgiaz wrote:
Hello again. I would like to do forecast with regression model.
I use this source code but the result won't come out and I don't know what could be wrong.
We need a lot more information than just saying that the results don't come out.
Please be specific and detailed.
Show us the SAS LOG (Click on the {i} icon and paste the log into that window DO NOT SKIP THIS STEP)
Show us the results where you don't see what you want to see.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It says like this
NOTE: The previous statement has been deleted.
132 *Peramalan;
133 forecast out = ramalan lead = 12;
--------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
134 run;
WARNING: RUN statement ignored due to previous errors. Submit QUIT; to terminate the procedure.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.RES may be incomplete. When this step was stopped there were 36
observations and 14 variables.
WARNING: Data set WORK.RES was not replaced because this step was stopped.
NOTE: PROCEDURE REG used (Total process time):
real time 17.98 seconds
cpu time 2.07 seconds
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Click on the {i} icon and paste the log into that window DO NOT SKIP THIS STEP
Don't just show us the errors, we need to see the entire LOG for this PROC.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sure, is this explain enough?
161 proc reg data = armaxvlp;
162 model Bill = Waktu DL1 DL2 DL3 D1 D2 D3 D4 D5 D6 Mt/influence;
163 output out = Res R = Bill_Res;
164 run;
165 *Pemodelan ARMAX Variasi Liburan dan Perdagangan Trend Deterministik Tanpa Variabel
165! Konstan;
NOTE: The data set WORK.RES has 36 observations and 14 variables.
NOTE: PROCEDURE REG used (Total process time):
real time 2.15 seconds
cpu time 0.53 seconds
166 proc reg data = armaxvlp;
167 model Bill = Waktu DL1 DL2 DL3 D1 D2 D3 D4 D5 D6 Mt/noint;
168 output out = Res R = Bill_Res;
169 run;
170 *Peramalan;
171 forecast out = ramalan lead = 12;
--------
180
NOTE: The previous statement has been deleted.
ERROR 180-322: Statement is not valid or it is used out of proper order.
172 run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
We're trying to help you, but you have to help us. Click on the {i} icon and paste the log into that window.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I can not find the {i} icon
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It is in the icon bar immediately above where you type your messages, sixth from the left.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
210 proc reg data = armaxvlp; 211 model Bill = Waktu DL1 DL2 DL3 D1 D2 D3 D4 D5 D6 Mt/noint; 212 output out = Res R = Bill_Res; 213 run; 214 215 *Peramalan; 216 forecast out = ramalan lead = 12; -------- 180 NOTE: The previous statement has been deleted. ERROR 180-322: Statement is not valid or it is used out of proper order. 217 run; WARNING: RUN statement ignored due to previous errors. Submit QUIT; to terminate the procedure. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.RES may be incomplete. When this step was stopped there were 36 observations and 14 variables. WARNING: Data set WORK.RES was not replaced because this step was stopped. NOTE: PROCEDURE REG used (Total process time): real time 2.00 seconds cpu time 0.53 seconds 218 proc print data = ramalan (obs = 48); ERROR: File WORK.RAMALAN.DATA does not exist. 219 run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks.
There is no FORECAST statement in PROC REG. So, the FORECAST statement doesn't execute and produce an output data set. When you put a RUN; statement in PROC REG, it executes the command, but does not end PROC REG. You need a QUIT; statement to end PROC REG, it should go immediately after the RUN; statement.
If you want to do a time series forecast, there are other tools that can do this (one is PROC ARIMA), or you can have PROC REG do a very crude forecast, for example if you had data from 1980 to 2018, and the year is a term in the model, you could have a crude forecast from PROC REG for 2019, but I don't see how that would fit here, as you don't seem to have a time variable in your model.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have the time variable which I named it as "Waktu". If that so, I still can have the forecast from the proc reg?
Because, actually I use the regression analysis on my time series data to analyze holiday and trading day variation.
So I got the regression model as its best fit and want to do the forecast for at least a year.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you are fitting a regression on a monthly data set, from 2016 to 2018, and now you want forecasts for 2019, you can get predicted values for 2019 but you need to have all the values of the x-variables in the regression present, plus Waktu must be months in 2019.
In other words, all the variables in
model Bill = Waktu DL1 DL2 DL3 D1 D2 D3 D4 D5 D6 Mt/noint;
except for the y-variable BILL must be present (not missing). Then you can get predicted values from the output statement.
output out = Res R = Bill_Res p=bill_pred;
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
But if I have all the value of x variables untill 2019, I will have different value of parameters for the best fit models, right? how about that...
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@sasgiaz wrote:
But if I have all the value of x variables untill 2019, I will have different value of parameters for the best fit models, right? how about that...
I don't know what you mean. Explain further.
Paige Miller