全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
8501 3
2014-04-24
SAS作ADF 单位根检验时需要根据AIC准则确定最优滞后阶数,可是网上看到的程序是这样的:
proc arima data=Work.Cybindex;
   identify var=cybindex(1)  stationarity=(adf=1);
run;

这样,滞后阶数被人为定为1了,该如何操作?

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-1-18 21:58:03
sas编写单位根检验程序
先对原时间序列数据进行处理,然后利用reg过程求出回归参数t检验对应的t值,然后与ADF检验的临界值(-2.902358,在显著性水平为0.05的情况下)进行比较。示例程序如下:
data simulation;
     do i=1 to 100;
          x=rannor(1234);
          output;
    end;
run;
data timeseries;
     set simulation;
     x_1st_lag= lag1(x);
     x_1st_diff= dif1(x);
     x_1st_diff_1st_lag= dif1(lag1(x));
     x_1st_diff_2nd_lag= dif1(lag2(x));
     x_1st_diff_3rd_lag= dif1(lag3(x));
     x_1st_diff_4th_lag= dif1(lag4(x));
     x_1st_diff_5th_lag= dif1(lag5(x));
run;
ods output parameterestimates=est(where=(variable="x_1st_lag") keep=variable tvalue);
ods select none;
proc reg data=timeseries;
     model x_1st_diff= x_1st_lag
                                    x_1st_diff_1st_lag
                                    x_1st_diff_2nd_lag
                                    x_1st_diff_3rd_lag
                                    x_1st_diff_4th_lag
                                    x_1st_diff_5th_lag;
run;
quit;
ods select all;
ods output close;
data _null_;
     file print;
     if _n_=1 then do;
         put @20"Augmented Dickey-Fuller(ADF) Test for Stationary at level 5%";
         put @20"5% level Critical Values = -2.902358 ,level with 5 lags";
     end;
     set est;
     if tvalue gt -2.902358 then
     put / @20 "The x series is a non-stationary process when tested at level 5%";
     else
     put / @20  "The x series is a stationary process when tested at level 5%";
run;

eviews进行单位根检验较多,通过AIC SC准则判定
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2018-9-11 11:24:49
thank you for sharing
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2019-3-23 16:47:51
改一下这里:stationarity=(adf=1);
比如改为stationarity=(adf=0 1 2);就有0到2滞后阶数对应的结果啦


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群