xuelida您好,您提供的DF2检验以计算检验势的程序是这样的吧:
n=10000;/* the number of replications is 10000 */
T=100+500;/* 100 observations + 500 presample values */
seed1=12456456; /* fix the seed */
y0=0;
ptau=zeros(5,1);
for o(1,5,1);
rho={0.75,0.8,0.85,0.9,0.95};
k=zeros(n,1);
i=1;
do while i<=n;
y=zeros(T,1);
u=rndns(T,1,seed1);
y[1,1]=rho[o,1]*y0+u[1,1];
j=2;
do while j<=T;
y[j,1]=rho[o,1]*y[j-1,1]+u[j,1];
j=j+1;
endo;
y1= y[501:T,.]; /*discard the first 500 observations */
x=y[500:T-1,.];
xxi=invpd(x'x);
b=xxi*(x'y1);
e=y1-x*b;
s2=e'*e/(rows(x)-cols(x));
sd=sqrt(diag(s2*xxi));
tau[i,.]=(b-1)./sd; /*t统计量 */
if tau[i,.]<-2.60;
ptau[o,.]=ptau[o,.]+1;
endif;
i=i+1;
endo;
endfor;
ptau=ptau/n;
print ptau;
为什么我运行到tau[i,.]=(b-1)./sd; /*t统计量 */这一行时,gauss就显示:error G0458 : Attempt to index PROC/FN/KEYWORD as a matrix。
您知道这是怎么回事吗?
希望得到您的帮助!谢谢。

[em01]