>> T=7;
N=13;
W=normw(w1);
y=zh(:,[1]);
x=zh(:,[2,3,4,5]);
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;
info.model=1;
info.fe=0;
results=sar_panel_FE(y,x,W,T,info);
vnames=strvcat('logcit','logp','logy');
prt_spnew(results,vnames,1)
% Print out effects estimates
spat_model=0;
direct_indirect_effects_estimates(results,W,spat_model);
panel_effects_sar(results,vnames,W);
错误使用 sum
数据类型无效。第一个参数必须为数值或逻辑值。
出错 normw (line 33)
nterm = sum(W, n);
我是个新手,基本的都不太懂,请问为什么出现错误,是我的数据定义错了吗?要怎么改呢?我的数据和权重就是直接从Excel里导入的,这个有影响吗