林静树 发表于 2015-7-18 16:36 
大神,今下午又重新试了下,终于出来结果了,首先是万分感谢!!但今下午做最后的Hausman test FE versus ...
在么,亲我想问一下你是如何处理好的,像这种情况,我的代码如下:
[data,name]=xlsread('paper',1);
weight=xlsread('paper',2);
T=7;
N=31;
W=normw(weight);
y=data(:,[3]);
x=data(:,[4,6,7,8,9]);
for t=1:T
t1=(t-1)*N+1;t2=t*N;
wx(t1:t2,:)=W*x(t1:t2,:);
end
xconstant=ones(N*T,1);
[nobs K]=size(x);
info.lflag=0; % required for exact results
info.model=1;
info.fe=0; % Do not print intercept and fixed effects; use info.fe=1 to turn on
results=sar_panel_FE(y,[x wx],W,T,info);
vnames=strvcat('lnpatent','lnagglo','hum','fina','gov','open',...
'W*lnagglo','W*hum','W*fina','W*gov','W*open');
prt_spnew(results,vnames,1)
% Print out effects estimates
spat_model=1;
direct_indirect_effects_estimates(results,W,spat_model);
panel_effects_sdm(results,vnames,W);
运行结果为:
Variable Coefficient Asymptot t-stat z-probability
lnagglo 0.256695 1.774356 0.076004
hum 0.890629 9.209468 0.000000
fina 0.022616 0.871118 0.383690
gov -3.043380 -4.692887 0.000003
open 0.601496 2.008001 0.044643
W*lnagglo -0.045638 -0.268367 0.788416
W*hum -0.720484 -5.511309 0.000000
W*fina -0.049199 -1.440206 0.149809
W*gov 2.388735 3.189561 0.001425
W*open -0.255052 -0.610368 0.541618
W*dep.var. 0.637995 11.350038 0.000000
未定义函数或变量 'direct_indirect_effects_estimates'。
不知道是不是没有这个函数呢,能否加一下QQ呢,我的QQ是1436657007