BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Tamino
Obsidian | Level 7

Hi,

 

I am doing an interrupted time-series analysis and use the autoreg procedure. I have difficulties to understand what excatly the nlag= option does in this procedure as it changes my results minimally, but the follow-up graph practically not at all.

 

Would be great if someone could shortly explain the function of the nlag= option simple.

 

Thank you very much!

 

Here is my SAS coding:

proc autoreg data=mydata;
model measurements = preintervention intervention postintervention sin cos/ method=ml nlag=1 /*dw=5*/ dwprob 
covb;
output out=autoreg_out predicted=pred pm=trend lcl=pred_l ucl=pred_u residual=resid
        predictedm=predm lclm=predm_l uclm=predm_u residualm=residm;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello,

 

Is the documentation not clear enough?

This is what the doc says :

The AUTOREG Procedure
SAS/ETS® 15.2 User's Guide

https://go.documentation.sas.com/doc/en/etsug/15.2/etsug_autoreg_syntax05.htm

 

NLAG=number
NLAG=(number-list)

specifies the order of the autoregressive error process or the subset of autoregressive error lags to be fitted. Note that NLAG=3 is the same as NLAG=(1 2 3). If the NLAG= option is not specified, PROC AUTOREG does not fit an autoregressive model.

 

Thus, for nlag=3, you believe (and test) that the lags 1, 2 and 3 of the target variable (=dependent variable) are playing a role in modelling it.

 

Thanks,

Koen

 

View solution in original post

2 REPLIES 2
sbxkoenk
SAS Super FREQ

Hello,

 

Is the documentation not clear enough?

This is what the doc says :

The AUTOREG Procedure
SAS/ETS® 15.2 User's Guide

https://go.documentation.sas.com/doc/en/etsug/15.2/etsug_autoreg_syntax05.htm

 

NLAG=number
NLAG=(number-list)

specifies the order of the autoregressive error process or the subset of autoregressive error lags to be fitted. Note that NLAG=3 is the same as NLAG=(1 2 3). If the NLAG= option is not specified, PROC AUTOREG does not fit an autoregressive model.

 

Thus, for nlag=3, you believe (and test) that the lags 1, 2 and 3 of the target variable (=dependent variable) are playing a role in modelling it.

 

Thanks,

Koen

 

PGStats
Opal | Level 21

Specifying option nlag=1 is loosely like requesting :

 

model measurements = measurements_1 preintervention intervention postintervention sin cos/ method=ml  dwprob covb;

 

where measurements_1 is the measurement value from the preceeding observation. I.e. you model the measurements as depending not only on independent variables but also on the previous state of the system.

PG

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Discussion stats
  • 2 replies
  • 1898 views
  • 2 likes
  • 3 in conversation