自己作研究时写的一些程序。也许对一部分人有用。
DM 'LOG; Clear; Output;Clear;';
/* Example Program for Misspecification Testing */
PROC IMPORT OUT= WORK.SLIP
DATAFILE= "H:\AGEC6213\SLIP.xls"
DBMS=EXCEL2000 REPLACE;
GETNAMES=YES;
data slip; set slip;
t+1;
Proc Reg simple;
model slip = buysell ny ncv;
plot predicted.*residual.;
Proc Autoreg archtest dwprob;
model slip = buysell ny ncv/ reset godfrey normal chow = 148;
output out =two resid = ehat;
Data mtest;set two;
esquared = ehat * ehat;
lagesqu = lag(esquared);
lagehat = lag(ehat);
ncv2 = ncv * ncv;/* Other squared terms are not included because they are dummies */
ncvny = ncv * ny;
ncvbuy = ncv * buysell;
t+1;
Proc reg;
model esquared = buysell ny ncv;/* Static heteroskedasticity */
model ehat = t buysell ny ncv;/* Structural change using a time trend */
Proc reg;/* Joint Tests */
model ehat = lagehat t ncv2 ncvny ncvbuy buysell ny ncv;/* Joint conditional mean */
model esquared = lagesqu buysell ny ncv;/* Joint conditional variance */
run;
[此贴子已经被作者于2007-2-9 7:21:19编辑过]