BookmarkSubscribeRSS Feed
daisywl
Calcite | Level 5

Hi, 

How can I obtain the p-value of the ADF test, which uses AIC or BIC to determine the lag for residuals, in order to test the stationarity of the residuals of a linear regression model?

 

I have tried proc arima but don’t know how to set the AIC/BIC option for lag length.

The input data and my code:

data df;
input month dep ind1 ind2 ind3;
cards;
1 -4.66344 0.5337595 1.533904 -0.1824561
2 -4.27203 0.5371667 1.638746 -0.2840759
3 -4.31303 0.5187737 1.708084 -0.208212
4 -3.46126 0.501581 1.773411 0.7434088
5 -3.10906 0.5024615 -0.7010086 0.4447428
6 -2.83321 0.50575 0.7289928 0.2619768
7 -2.74544 0.4943883 0.7419567 0.7679318
8 -3.30505 0.4825768 0.7544792 0.273685
9 -3.28185 0.468799 0.9924411 -0.1544852
10 -3.54578 0.4705212 1.133435 0.6179188
;
run;

proc reg 
	data=df;
	model dep = ind1	ind2	ind3 ; 
	OUTPUT OUT=model_output_c predicted= pred residual=resid;
run;

proc arima data=model_output_c;
  identify var=resid STATIONARITY=(ADF) ;
run;

Thank you!

 

1 REPLY 1
SASCom1
SAS Employee

Hello @daisywl 

If you specify ADF option, the output in PROC ARIMA  contains p values for the ADF test, as in the columns 'Pr<Rho', 'Pr<Tau', 'Pr > F'. If by saying "how to set the AIC/BIC option for lag length", you are asking if there is an option in PROC ARIMA to select the number of augmenting lags based on AIC/BIC in performing the ADF stationarity test, then PROC ARIMA does not provide an option to select the number of augmenting lags using AIC/BIC method, or using any other method. You will need to determine the number of augmenting lags yourself when performing the ADF test in PROC ARIMA. 

 

There are different ways to select number of augmenting lags in ADF test. Dr. David Dickey illustrates one approach to select the number of augmenting lags in performing ADF test in the following Global Forum paper, which uses F test in PROC REG to test for significance on the coefficients associated with the lags in the regression. In particular, this approach is discussed in section 7 of the paper:

 

https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/192-30.pdf

 

Another SAS/ETS procedure, PROC AUTOREG supports some additional stationarity tests(in addition to the ADF test), e.g., ERS, NP stationarity tests, which use some information criteria(SBC for ERS test and modified AIC for the NP test) to determine the number of lags to be included in the regression. You can specify ERS  option, NP  option in the MODEL statement in PROC AUTOREG to requests these tests:


https://go.documentation.sas.com/doc/en/pgmsascdc/v_050/etsug/etsug_autoreg_syntax06.htm#etsug_autor...

 

then scroll down to:

 

STATIONARITY=(ERS)
STATIONARITY=(ERS=(value))
STATIONARITY=(NP)
STATIONARITY=(NP=(value))

 

where 'value' is the maximum lag length to be considered in the lag order selection in the stationarity test.

 

I hope this helps. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 468 views
  • 2 likes
  • 2 in conversation