如何用SAS做ADF检验,多变量? 怎么用SAS编写ADF单位根检验,在线等答案,求高人指点。
\u5982\u4f55\u7528SAS\u8f6f\u4ef6\u5bf9\u6536\u76ca\u7387\u65f6\u95f4\u5e8f\u5217\u505aADF\u68c0\u9a8c\uff1f\u5bf9\u4e8e\u5355\u4f4d\u6839\u4e5f\u53ef\u4ee5\u4f7f\u7528PP\u68c0\u9a8c\uff0c\u7a0b\u5e8f\u4e3a\uff1a PROC AUTOREG DATA=\u6570\u636e\u96c6\u540d\uff1b MODEL \u88ab\u68c0\u9a8c\u53d8\u91cf=/stationarity=(pp); RUN\uff1b\u7a0b\u5e8f\u7684\u7ed3\u679c\u7ed9\u51fa\u4e86\u6ca1\u6709\u5e38\u6570\u9879\u3001\u6709\u5e38\u6570\u9879\u3001\u5e38\u6570\u9879\u548c\u8d8b\u52bf\u9879\u7684\u4e09\u79cd\u68c0\u9a8c\u60c5\u51b5\u3002\u5224\u65ad\u7684\u4f9d\u636e\u662f\u770b\u540e\u9762\u7684\u68c0\u9a8c\u6982\u7387\u3002\u5bf9\u4e8e\u534f\u6574\u5206\u6790\uff0c\u5176\u7a0b\u5e8f\u4e3a PROC AUTOREG DATA=\u6570\u636e\u96c6\u540d\uff1b MODEL \u88ab\u68c0\u9a8c\u53d8\u91cf=\u89e3\u91ca\u53d8\u91cf/stationarity=(pp); RUN\uff1b\u4f46\u534f\u6574\u68c0\u9a8c\u53ea\u7ed9\u51faT\u503c\uff0c\u4f60\u9700\u8981\u67e5\u4e34\u754c\u503c\u624d\u80fd\u5224\u65ad\u3002
\u5148\u5bf9\u539f\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u8fdb\u884c\u5904\u7406\uff0c\u7136\u540e\u5229\u7528reg\u8fc7\u7a0b\u6c42\u51fa\u56de\u5f52\u53c2\u6570t\u68c0\u9a8c\u5bf9\u5e94\u7684t\u503c\uff0c\u7136\u540e\u4e0eADF\u68c0\u9a8c\u7684\u4e34\u754c\u503c(-2.902358\uff0c\u5728\u663e\u8457\u6027\u6c34\u5e73\u4e3a0.05\u7684\u60c5\u51b5\u4e0b\uff09\u8fdb\u884c\u6bd4\u8f83\u3002\u793a\u4f8b\u7a0b\u5e8f\u5982\u4e0b\uff1a
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;
绛旓細瀵逛簬鍗曚綅鏍逛篃鍙互浣跨敤PP妫楠岋紝绋嬪簭涓猴細 PROC AUTOREG DATA=鏁版嵁闆嗗悕锛 MODEL 琚楠屽彉閲=/stationarity=(pp); RUN锛涚▼搴鐨缁撴灉缁欏嚭浜嗘病鏈夊父鏁伴」銆佹湁甯告暟椤广佸父鏁伴」鍜岃秼鍔块」鐨勪笁绉嶆楠屾儏鍐点傚垽鏂殑渚濇嵁鏄湅鍚庨潰鐨勬楠屾鐜囥傚浜庡崗鏁村垎鏋愶紝鍏剁▼搴忎负 PROC AUTOREG DATA=鏁版嵁闆嗗悕锛 MODEL 琚楠屽彉閲=瑙...
绛旓細鍏堝鍘熸椂闂村簭鍒楁暟鎹杩涜澶勭悊锛岀劧鍚庡埄鐢╮eg杩囩▼姹傚嚭鍥炲綊鍙傛暟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_...
绛旓細鎴戠敤鐨勬槸Eviews6.0锛孉DF妫楠屾楠わ細Ouick-->series staticstics-->unit root text-->杈撳叆搴忓垪鍚嶇О鍗冲彲锛岀劧鍚庢樉绀虹殑鐣岄潰鍙互閫夋嫨level 鍗虫楠屽師濮嬪簭鍒楁槸鍚﹀钩绋锛岃繕鍙互妫楠屼竴闃跺樊鍒 浜岄樁宸垎鏄惁骞崇ǔ 锛岀浉淇′綘鍒拌繖涓姝ワ紝鐪嬪埌鐣岄潰鎻愮ず灏辫兘鍋氫簡銆備竴鑸敤ADF妫楠屽氨鍙互浜嗐傚摝锛屼互涓婂墠鎻愭槸灏嗕綘鐨勬暟鎹鍏...
绛旓細1锛夎繛鎺D,鈭礎B=AC ,AD鏄枩杈笲C涓婁腑绾,鈭碅D鈯C,BD=AD=CD,鈭燚BE=鈭燚AF=45 鈭礏D=AD,鈭燚BE=鈭燚AF=45,BE=AF 鈭粹柍EBD鈮屸柍ADF(SAS)鈭碊E=DF,鈭燘DE=鈭燗DF 鈭礎D鈯C 鈭粹垹ADB=90 鍙堚垹ADB=鈭燗DE+鈭燚BE=90,鈭燘DE=鈭燗DF 鈭粹垹ADE+鈭燗DF=90,鈭碘垹EDF=鈭燗DE+鈭燗DF 鈭粹垹EDF=90 鈭礑E=DF,...
绛旓細鍥炵瓟锛歍ype Lags Rho Pr <Rho Tau Pr<Tau F Pr > F鏄粈涔堟剰鎬
绛旓細proc autoreg data = gnp;model y = / stationarity =(adf =3);run;
绛旓細棣栧厛锛孌F妫楠岀粺璁¢噺璁$畻锛氭櫘閫欰R(1)杩囩▼锛氬埄鐢ㄦ渶灏忎簩涔樻硶璁$畻锛屽[鍏紡]锛屾牱鏈暟鎹甗鍏紡]锛屽緱鍒癧鍏紡]鍜孾鍏紡]銆傚甫婕傜Щ椤圭殑AR(1)杩囩▼锛氱被浼艰繃绋嬶紝[鍏紡]涓哄叧閿紝[鍏紡]鐨勮绠楁柟娉曚笉鍙樸傝秼鍔垮钩绋矨R(1)杩囩▼锛氬悓鏍峰鐞嗭紝[鍏紡]鏄叧閿ADF妫楠岋紝鍗冲骞鐨DF妫楠岋紝澶勭悊AR(p)妯″瀷鏃讹紝鏈変笁绉嶅搴旀儏鍐...
绛旓細proc arima data=out;identify var=x stationarity=(adf=1) ;run;
绛旓細AD锛滱B 鈭燘AE锛濃垹DAF AE锛滱F 鈭粹柍ABE鈮屸柍ADF锛SAS锛夛紱锛2锛夊浘涓槸閫氳繃缁曠偣A鏃嬭浆90掳锛屼娇鈻矨BE鍙樺埌鈻ADF鐨浣嶇疆锛庯紙3锛夎В锛氣埖鍥涜竟褰BCD涓烘鏂瑰舰锛屸埓AD=AB锛屸垹BAD=90掳锛屸埖E鏄疉D鐨勪腑鐐癸紝AF=1/2AB锛屸埓AE=AF锛屸埓鎶娾柍ABE缁曠偣A閫嗘椂閽堟棆杞90掳鍙緱鍒扳柍ADF锛鈭碆E=DF锛孊E鈯F锛...
绛旓細Tau 鐨P鍊煎皬浜0.05鎴栬0.001锛屽钩绋 杩欎釜鐢╡views鐪嬫洿绠鍗曪紝鐪1% 5% 鐨刢ritical value?涔熷氨鏄痯灏忎簬鍙互鎷掔粷adf鍋囪(series甯nit root)