3786 3

[统计软件] matlab做LMerr和LMlag检验 [推广有奖]

  • 0关注
  • 11粉丝

已卖:2480份资源

副教授

26%

还不是VIP/贵宾

-

威望
0
论坛币
36205 个
通用积分
41.5519
学术水平
12 点
热心指数
17 点
信用等级
14 点
经验
27198 点
帖子
403
精华
0
在线时间
340 小时
注册时间
2012-9-14
最后登录
2015-4-2

楼主
◇水藍ē蕨ˇ 学生认证  发表于 2015-3-10 11:18:15 |AI写论文
10论坛币
matlab做LMerr和LMlag检验时,“lmlag_panel"函数不识别,在”jpl7 “文件夹中也未见次函数定义,求大神指教!!
代码如下:

spatial fixed effects + (robust) LM tests for spatial lag and spatial error model
fixed effects, within estimator
demeaning of the y and x variables
model=1;
[ywith,xwith,meanny,meannx,meanty,meantx]=demean(y,x,N,T,model);
results=ols(ywith,xwith);
vnames=strvcat('lny','lnAGr','lnPni','Pcl','lnEha','lnDlc'); % should be changed if x is changed
prt_reg(results,vnames);
sfe=meanny-meannx*results.beta; % including the constant term
yme = y - mean(y);
et=ones(T,1);
error=y-kron(et,sfe)-x*results.beta;
rsqr1 = error'*error;
rsqr2 = yme'*yme;
FE_rsqr2 = 1.0 - rsqr1/rsqr2 % r-squared including fixed effects
sige=results.sige*((nobs-K)/nobs);
logliksfe=-nobs/2*log(2*pi*sige)-1/(2*sige)*results.resid'*results.resid
LMsarsem_panel(results,W,ywith,xwith); % (Robust) LM tests

lm1=lmlag_panel(ywith,xwith,W);
prt_tests(lm1);

lm2=lmerror_panel(ywith,xwith,W);
prt_tests(lm2);

lm3=lmlag_robust_panel(ywith,xwith,W);
prt_tests(lm3);

lm4=lmerror_robust_panel(ywith,xwith,W);
prt_tests(lm4);



关键词:MATLAB matla atlab lmer Atl including matlab should within 文件夹

沙发
kelly281686527 发表于 2016-3-21 22:44:14
楼主你这个问题解决了么??

藤椅
叮叮当当呀 发表于 2016-7-31 19:42:38
请问谁解决了?

板凳
捡哦哦 学生认证  发表于 2018-5-4 09:14:06
好像是需要先下载一个Elhorst程序包,在工具箱里面添加。

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

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2025-12-9 12:06