空间计量SAR模型程序为:
clear all;
ziliao=xlsread('ziliao.xls');
weight=xlsread('weight.xls');
T=6;N=30;nobs=N*T;
W=normw(weight);
y=ziliao(:,[1]);
x=ziliao(:,[2,3,4]);
xconstant=ones(nobs,1);
info.lflag=0; % required for exact results
info.model=0;
results=sar_panel(y,[xconstant x],W,T,info); % Elhorst
vnames=strvcat('y','constant','x1','x2','x3');
prt(results,vnames); % Elhorst
% ----------------------------------------------------------------------------------------
% spatial fixed effects + spatial autocorrelation
info.lflag=0;
info.model=1;
results=sar_panel(y,x,W,T,info);
vnames=strvcat('y','x1','x2','x3');
prt(results,vnames);
% ----------------------------------------------------------------------------------------
% time period fixed effects + spatial autocorrelation
info.lflag=0;
info.model=2;
results=sar_panel(y,x,W,T,info);
vnames=strvcat('y','x1','x2','x3');
prt(results,vnames);
% ----------------------------------------------------------------------------------------
% spatial and time period fixed effects + spatial autocorrelation
info.lflag=0;
info.model=3;
results=sar_panel(y,x,W,T,info);
vnames=strvcat('y','x1','x2','x3');
prt(results,vnames);
这个程序执行后老是出现下面的问题:
??? Reference to non-existent field 'corr2'.
Error in ==> prt_spnew at 143
fprintf(fid,'corr-squared = %9.4f \n',results.corr2);
Error in ==> prt at 98
prt_spnew(results,vnames);
请问各位大侠这是怎么回事呢?如何修改呢?