我在空间面板计量程序中,demopanelscompare程序试行出错于prt_sp, 出错提示如下:
??? Error using ==> prt_sp at 77
results structure not known by prt_sp function
Error in ==> demopanelscompare at 61
prt_sp(results,vnames,1);
根据提示查错,demopanelscompare 61行为以下程序红色部分:
% No fixed effects + spatially lagged dependent variable
info.lflag=0; % required for exact results
info.model=0;
info.fe=0; % Do not print intercept and fixed effects; use info.fe=1 to turn on
% New routines to calculate effects estimates
results=sar_panel_FE(y,[xconstant x],W,T,info);
vnames=strvcat('logcit','intercept','logp','logy');
% Print out coefficient estimates
prt_sp(results,vnames,1);
% Print out effects estimates
prt_sp 77 行是以下程序红色部分:
switch results.meth
case {'sem'}
fprintf(fid,'Pooled model with spatial error autocorrelation, no fixed effects \n');
case {'semsfe'}
fprintf(fid,'Pooled model with spatial error autocorrelation and spatial fixed effects \n');
case {'semtfe'}
fprintf(fid,'Pooled model with spatial error autocorrelation and time period fixed effects \n');
case {'semstfe'}
fprintf(fid,'Pooled model with spatial error autocorrelation, spatial and time period fixed effects \n');
case {'sar'}
fprintf(fid,'Pooled model with spatially lagged dependent variable, no fixed effects \n');
case {'sarsfe'}
fprintf(fid,'Pooled model with spatially lagged dependent variable and spatial fixed effects \n');
case {'sartfe'}
fprintf(fid,'Pooled model with spatially lagged dependent variable and time period fixed effects \n');
case {'sarstfe'}
fprintf(fid,'Pooled model with spatially lagged dependent variable, spatial and time period fixed effects \n');
otherwise
error('results structure not known by prt_sp function');
end % switch statement
根据提示的意思是,results.meth里没有上面的任何结果。我找到result.meth,里面只有一个结果是 psar。这是什么?psar是那种类型的空间面板回归??还是之前的程序有误?
在https://bbs.pinggu.org/thread-1575198-1-1.html中有提到,ELHORST的代码集成和其它空间计量程序有冲突,我想是不是prt_sp 的问题。找了好几个prt_sp,目前用的这个是程序跑的最远的了!
如今连demo都跑不出来,更不要提试自己的数据了!求高手解救!
附件的程序是我在 http://www.regroningen.nl/elhorst/software.shtml 下载的,要试行还缺少其它空间计量函数。我从另外一个kongjian 计量包里补充。所以附上的程序是补充过的。
另外,https://bbs.pinggu.org/thread-1575198-1-1.html 有另一版的Elhorst code。由于不能重复就不上传了。