matlab matpool设置,matlab 做面板分析时出现报错情形 怎样解决?

在做空间面板分析时,我想比较一般面板和空间面板的区别,所以就用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文件,望高手指导!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值