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?
The input data and model that I have:
data df;
input dep ind1 ind2 ind3;
cards;
-4.66344 0.5337595 1.533904 -0.1824561
-4.27203 0.5371667 1.638746 -0.2840759
-4.31303 0.5187737 1.708084 -0.208212
-3.46126 0.501581 1.773411 0.7434088
-3.10906 0.5024615 -0.7010086 0.4447428
-2.83321 0.50575 0.7289928 0.2619768
-2.74544 0.4943883 0.7419567 0.7679318
-3.30505 0.4825768 0.7544792 0.273685
-3.28185 0.468799 0.9924411 -0.1544852
-3.54578 0.4705212 1.133435 0.6179188
;
run;
proc reg
data=df;
model dep = ind1 ind2 ind3 ;
run;
Thank you!
Sometimes Mr. Google and Ms. Wikipedia can lead you to an interesting result:
In SAS, PROC ARIMA can perform ADF tests
So, do you have access to SAS/ETS? If so, this is not a difficult request. However, if your data are not from a time series (or something resembling a time series), I wonder if the effort to come up with an approximate ADF test is worth it, considering that many of the assumptions for the test are not being met. If you are looking for a test for autocorrelation of the residuals in PROC REG, then you can get the Durbin-Watson statistic, but that really only tests for a lag of 1, and requires that the response variable be ordered in some sense (time, location, etc.).
SteveDenham
Thank you for your responses.
My data is actually monthly, but I have dropped the ‘Month’ column. I have tried the ADF test as a secondary test when validating the model.
I have tried proc arima but don’t know how to set the AIC/BIC option for lag length.
This is my code:
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;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.