BookmarkSubscribeRSS Feed
su17
Calcite | Level 5

I am looking to generate ex post forecasts from an ADL(1,1) model. So after the first observation the lagged dependent variable value is not the prior period actual value but rather the prior period predicted value. And this is carried on over the forecast horizon. I do not see that as possible using a SAS procedure (e.g., AUTOREG) so I think this has to be separate coding exercise/macro. Any help anyone can share would be greatly appreciated. Say I have a ADL model with two X variables and one period lags. Thanks.

1 REPLY 1
dw_sas
SAS Employee

Hi @su17 , 

 

If you have already used PROC AUTOREG to estimate your model, then one approach you can use to compute forecasts as you described is PROC SIMLIN.  (This is an old procedure, but useful for this case!)  A second approach is to use PROC MODEL to estimate the model parameters and compute the simulated values in one step.  The OUT= data sets produced by these two procedures are structured differently, but the results should be the same for your linear model.  Both approaches are illustrated in the syntax below:

 

  /* Approach 1 */
proc autoreg data=a outest=est;
  model y=lag_y lag_x1 lag_x2;
run;

proc simlin data=a est=est start=2;
  endo y;
  exog lag_x1 lag_x2;
  lagged lag_y y 1;
  output out=simlin_out p=expost;
run;

proc print data=simlin_out;
run;

  /* Approach 2 */
proc model data=a;
  endo y;
  exog x1 x2;
  parms b0 a b1 b2;
  y = b0 + a*lag(y) + b1*lag(x1) + b2*lag(x2);
  fit y / outest=mod_est;
  solve y / estdata=mod_est start=1 out=model_out outactual outpredict;
run;
quit;

proc print data=model_out;
run;

If the approaches described above do not produce your desired results, then please provide an example which illustrates your model and expected results.  

 

I hope this helps!

DW

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 543 views
  • 1 like
  • 2 in conversation