楼主: mbalaoda
751 1

[问答] 使用Matlab:错误使用 mprint (line 231) Wrong # rnames in mprint,怎么解决 [推广有奖]

  • 0关注
  • 0粉丝

本科生

24%

还不是VIP/贵宾

-

威望
0
论坛币
360 个
通用积分
2.0005
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1752 点
帖子
42
精华
0
在线时间
77 小时
注册时间
2011-6-8
最后登录
2022-5-8

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
请问大牛们:在使用Matlab:错误使用 mprint (line 231) Wrong # rnames in mprint,怎么解决?
程序如下:
T=12;
N=10;
W=normw(W1);
y=A(:,[23]);
x=A(:,[17:22]);
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('logE’,’intercept’,’logshx’,’logPOP’,’logGDP’,’logSGDP','loginvest','logEgdp');
prt_spnew(results,vnames,1)
spat_model=0;
direct_indirect_effects_estimates(results,W,spat_model);
panel_effects_sar(results,vnames,W);

运行结果为:
Wrong # of variable names in prt_reg -- check vnames argument
will use generic variable names

Ordinary Least-squares Estimates
R-squared      =    0.9229
Rbar-squared   =    0.9188
sigma^2        =    0.0593
Durbin-Watson  =    1.7247
Nobs, Nvars    =    120,     7
***************************************************************
Variable        Coefficient      t-statistic    t-probability
variable 1        12.955394        29.899434         0.000000
variable 2         0.107677         1.534543         0.127691
variable 3         0.046165         0.482356         0.630486
variable 4         1.296638         8.521197         0.000000
variable 5        -0.946691       -17.107434         0.000000
variable 6        -0.080238        -1.576146         0.117788
variable 7        -0.039277        -0.294729         0.768742


T =

    12

LM test no spatial lag, probability          =   24.9098,    0.000
robust LM test no spatial lag, probability   =   39.4198,    0.000
LM test no spatial error, probability        =    0.0070,    0.933
robust LM test no spatial error, probability =   14.5170,    0.000
>> bbw10-sfe
尝试将 SCRIPT bbw10 作为函数执行:
E:\bbw10.m

>> A=xlsread('E:\desktop\\bbw');
W1=xlsread('E:\desktop\\bbww1');
T=12;
N=10;
W=normw(W1);
y=A(:,[23]);
x=A(:,[17:22]);
>> 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('logE’,’intercept’,’logshx’,’logPOP’,’logGDP’,’logSGDP','loginvest','logEgdp');
prt_spnew(results,vnames,1)
spat_model=0;
direct_indirect_effects_estimates(results,W,spat_model);
panel_effects_sar(results,vnames,W);
Wrong # of variable names in prt_sp -- check vnames argument
will use generic variable names

Pooled model with spatially lagged dependent variable and spatial fixed effects
R-squared          =    0.9929   
corr-squared       =    0.7403   
sigma^2            =    0.0056
Nobs,Nvar,#FE      =    120,     7,    16  
log-likelihood     =        144.43011
# of iterations    =      1   
min and max rho    =   -1.1258,   1.0000
total time in secs =    1.3630
time for optimiz   =    0.1790
time for lndet     =    0.0470
time for eigs      =    0.5650
time for t-stats   =    0.0920
No lndet approximation used
***************************************************************
Variable        Coefficient  Asymptot t-stat    z-probability
variable 1         0.016704         0.529562         0.596416
variable 2        -0.138047        -1.172315         0.241071
variable 3        21.031091         2.190213         0.028509
variable 4       -20.789949        -2.162468         0.030582
variable 5         0.020312         0.708341         0.478733
variable 6        -0.100153        -1.216628         0.223746
W*dep.var.         0.262199         2.579782         0.009886

    direct    t-stat   indirect    t-stat   total    t-stat

ans =

    0.0167    0.5085    0.0052    0.4227    0.0220    0.4975
   -0.1394   -1.1663   -0.0493   -0.9503   -0.1888   -1.1492
   21.4270    2.1695    7.4555    1.4275   28.8825    2.0812
  -21.1807   -2.1423   -7.3734   -1.4166  -28.5541   -2.0556
    0.0208    0.7214    0.0068    0.5976    0.0277    0.7072
   -0.1021   -1.2320   -0.0354   -0.9666   -0.1376   -1.1981

错误使用 mprint (line 231)
Wrong # rnames in mprint

出错 panel_effects_sar (line 188)
mprint(printout,ini);

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:mprint MATLAB print Names matla

已有 1 人评分经验 收起 理由
nuomin + 80 鼓励积极发帖讨论

总评分: 经验 + 80   查看全部评分

沙发
wooseok11 发表于 2024-3-6 15:56:09 |只看作者 |坛友微信交流群
您好,我也遇到了同样的问题,请问您是如何解决的呢?

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-28 11:48