BookmarkSubscribeRSS Feed
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.

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;

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;

proc print data=simlin_out;

  /* 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;

proc print data=model_out;

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!




Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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
  • 1 like
  • 2 in conversation