楼主: 誉满天下.
1427 4

求助,这是为什么啊?为什么我弄不上去变量名,而且variable只有3个 [推广有奖]

  • 0关注
  • 0粉丝

初中生

85%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
1.0337
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
139 点
帖子
5
精华
0
在线时间
31 小时
注册时间
2018-6-25
最后登录
2019-7-31

楼主
誉满天下. 发表于 2019-5-27 02:05:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
T=11; % number of time periods
N=31; % number of regions
% row-normalize W
W=normw(W1); % function of LeSage
y=A(:,[4]); % column number in the data matrix that corresponds to the dependent variable
x=A(:,[5,11]); % column numbers in the data matrix that correspond to the independent variables
xconstant=ones(N*T,1);
[nobs K]=size(x);
% ----------------------------------------------------------------------------------------
% ols estimation
results=ols(y,[xconstant x]);
vnames=char('CXST','x1','x2','x3','x4','x5','x6','x7');
prt_reg(results,vnames,1);
sige=results.sige*((nobs-K)/nobs);
loglikols=-nobs/2*log(2*pi*sige)-1/(2*sige)*results.resid'*results.resid

% The (robust)LM tests developed by Elhorst

LMsarsem_panel(results,W,y,[xconstant x]); % (Robust) LM tests

% The lm tests developed by Donald Lacombe
% see http://www.rri.wvu.edu/lacombe/~lacombe.htm

lm1=lmlag_panel(y,[xconstant x],W);
prt_tests(lm1);

lm2=lmerror_panel(y,[xconstant x],W);
prt_tests(lm2);

lm3=lmlag_robust_panel(y,[xconstant x],W);
prt_tests(lm3);

lm4=lmerror_robust_panel(y,[xconstant x],W);
prt_tests(lm4);


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

Ordinary Least-squares Estimates
R-squared      =    0.0440
Rbar-squared   =    0.0383
sigma^2        =  119.5661
Durbin-Watson  =    0.3193
Nobs, Nvars    =    341,     3
****************************************??***********************
Variable        Coefficient      t-statistic    t-probability
variable 1         9.906080        11.754521         0.000000
variable 2         0.175004         1.236923         0.216974
variable 3         0.045317         3.524113         0.000483


loglikols =

  -1.2980e+03

LM test no spatial lag, probability          =  143.5858,    0.000
robust LM test no spatial lag, probability   =    0.7348,    0.391
LM test no spatial error, probability        =  144.8356,    0.000
robust LM test no spatial error, probability =    1.9846,    0.159
LM lag test for omitted spatial lag in panel data

LM value                 143.58581315
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

LM error test for spatial errors in panel data

LM value                 144.83556667
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

Robust LM lag test for omitted spatial lag in panel data

LM value                   0.73480738
Marginal Probability       0.39132935
chi(1) .01 value           6.64000000

Robust LM error test for spatial errors in panel data

LM value                   1.98456090
Marginal Probability       0.15891075
chi(1) .01 value           6.64000000

二维码

扫码加我 拉你入群

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

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


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

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

沙发
KateFun 发表于 2019-6-3 09:27:52
我觉得有可能是你的:x=A(:,[5,11]); % column numbers in the data matrix that
你改成[5,6,7..]这样的试试,就是一直列到11
看看是不是就好啦

藤椅
KateFun 发表于 2019-6-3 09:28:03
我觉得有可能是你的:x=A(:,[5,11]); % column numbers in the data matrix that
你改成[5,6,7..]这样的试试,就是一直列到11
看看是不是就好啦

板凳
KateFun 发表于 2019-6-3 09:28:27
我觉得有可能是你的:x=A(:,[5,11]); % column numbers in the data matrix that
你改成[5,6,7..]这样的试试,就是一直列到11
看看是不是就好啦

报纸
KateFun 发表于 2019-6-3 09:32:22
您好,我也在做这个,我想跟您交流一下,我也是运行跟您一模一样的程序,但是出现了空:未定义函数或变量 'lmlag_panel’,就卡在lm1=lmlag_panel(y,[xconstant x],W);就执行不下去了。请问您知道可能是什么原因嘛?你的工具箱安装了别的安装包吗?急求!

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-26 21:47