BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Taliah
Obsidian | Level 7
I am using proc autoreg. I get autoregression parameter estimates for data up to feb2018 (monthly data), having AR1 and 3 other predicting variables. I insert these parameter estimates into a formula to get the forcast values for mar2018 untill feb 2019. For the first AR1 value I use the actual Y value of the previous month. For each following AR1 value I use the predicted Y value for the previous month. The resulting forcast Y values I get make no sense. Is there another way to get the forcast values / the autoregression formula?

 

Example of the code I'm using:

proc autoreg data = table_a plots;

model y=a b c /

method = ml

maxiter=50

nlag = 1

backstep slstay = 0.0500

DW=1;

output out = table_b lcl=lcl ucl=ucl p=predicted r=residual alphacli=0.05;

run;

 

Thank you,

Tali

1 ACCEPTED SOLUTION

Accepted Solutions
Taliah
Obsidian | Level 7

Hi DW,

Thank you! that helps. I used 

Usage Note 40135 (http://support.sas.com/kb/40135) to get the autoregression equation and it seems to work,

 

Thank you!

View solution in original post

2 REPLIES 2
dw_sas
SAS Employee

Hi Tali,

 

PROC AUTOREG with the NLAG= option fits a regression model with an autoregressive error process.  When available, lags of the structural residuals are multiplied with the AR coefficients in the fitted model to obtain the predicted values.  When lagged structural residuals are no longer available, a best linear predicted of the structural residual is used.  For details, please see the following sections of the PROC AUTOREG documentation:

 

https://go.documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_autoreg_details02.htm&docsetVers...

 

https://go.documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_autoreg_details51.htm&docsetVers...

 

The following SAS Note might also be of interest to you:

 

http://support.sas.com/kb/40135

 

If you want to fit a model with a lagged dependent regressor and other exogenous variables, then you might want to consider using PROC VARMAX to model and forecast your data.  Please see the following section of the PROC VARMAX documentation for details:

 

https://go.documentation.sas.com/?docsetId=etsug&docsetVersion=15.1&docsetTarget=etsug_varmax_gettin...

 

I hope this helps!

DW

Taliah
Obsidian | Level 7

Hi DW,

Thank you! that helps. I used 

Usage Note 40135 (http://support.sas.com/kb/40135) to get the autoregression equation and it seems to work,

 

Thank you!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 790 views
  • 0 likes
  • 2 in conversation