在做空间面板分析时,我想比较一般面板和空间面板的区别,所以就用matlab做起了普通面板分析。但在做普通面板分析时老是出现报错的现象。
panel_d1是自带程序,是可以运行的。其程序为:
clear;
%carga los datos
load datat.txt; %Judge Example with Balanced Panel
%assign data
y= datat(:,2:3);
id = datat(:,1);
vnames = ['c', % Cost
'y']; % Output
% Pooled Estimation
results = ppooled(y);
prt_panel(results,vnames);
% Fixed Effects Estimation
result1 = pfixed(y,id);
prt_panel(result1,vnames);
% Random Effects Estimation
result2 = prandom(y,id);
prt_panel(result2,vnames);
我稍微变动下,编了个panel_d程序,程序为:
clear;
%carga los datos
load ppp.txt; %Judge Example with Balanced Panel
%assign data
y= ppp(:,2:3:4);%
id =ppp(:,1);
vnames = ['y',
'x1',
'x2']; % Output
% Pooled Estimation
results = ppooled(y);
prt_panel(results,vnames);
% Fixed Effects Estimation
result1 = pfixed(y,id);
prt_panel(result1,vnames);
% Random Effects Estimation
result2 = prandom(y,id);
prt_panel(result2,vnames);
% Haussman Test
phaussman(result1, result2);
运行改程序 就出现了报错提示:
Error using ==> panel_d at 16
Error using ==> vertcat
CAT arguments dimensions are not consistent.
附件里是做面板的m文件,望高手指导!!