hi all,
i'm very new to SAS but have programming experience with java. just wondering if anyone has an example code snippet that reads simple return from a file and compute the acf and pacf for 24 lags? thank you for your help in advance.
data will be in this format
date r
19700130 0.05
19700227 0.06
19700331 -0.03
......
.......
......
The identify statement in proc arima produces acf and pacf estimates. Proc arima is part of SAS/ETS.
hi, thanks for your reply. what are the statements that I need to write down please? I'm quite new to SAS so i'm not even sure how i should write the identify statements.
so if i have the below, what needs to be changed to output acf and pacf?
data crsp;
infile "\\C\\test.txt"
input date dec1;
proc arima data=crsp;
identify var=dec1 nlag=24 stationarity=(adf);
run;
See introductory example in the proc ARIMA documentation
thanks, i can see the acf and pacf's graph are there but I need a table which has all the numbers for ACF and PACF like below. how do I do it?
and how do I run Ljung-box test to test my hypothesis that first 12 lags ACF is 0?
lag acf pacf
1 0.2 0.2
2 0.1 0.1
3 0.05 0.05
...
23
24
To get the graph data you will need to use ods output statement:
ODS OUTPUT AutoCorrGraph=myACFdata PACFgraph=myPACFdata;
You should be getting the Ljung-box statistic in a table out of the identify statement output. Specify whitenoise=ignoremiss if your data contains missing values.
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.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.