楼主: 凹凸平原
6426 16

[问答] 空间面板中,这三个model都是代表的什么模型 [推广有奖]

  • 3关注
  • 1粉丝

已卖:35份资源

硕士生

70%

还不是VIP/贵宾

-

威望
0
论坛币
389 个
通用积分
23.8357
学术水平
1 点
热心指数
2 点
信用等级
1 点
经验
3722 点
帖子
88
精华
0
在线时间
282 小时
注册时间
2010-8-26
最后登录
2022-4-29

楼主
凹凸平原 在职认证  发表于 2013-3-26 21:13:05 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
clear all;
A=xlsread('C:\MATLAB7\da.xls');
W1=xlsread('C:\MATLAB7\qz.xls');
% Dataset downloaded from www.wiley.co.uk/baltagi/
% Spatial weights matrix constructed by Elhorst
%
% written by: J.Paul Elhorst summer 2008
% University of Groningen
% Department of Economics
% 9700AV Groningen
% the Netherlands
% j.p.elhorst@rug.nl
%
% REFERENCES:
% Elhorst JP (2009) Spatial Panel Data Models. In Fischer MM, Getis A (Eds.)
% Handbook of Applied Spatial Analysis, Ch. C.2. Springer: Berlin Heidelberg New York.
%
% dimensions of the problem
T=15; % number of time periods
N=30; % number of regions
% row-normalize W
W=normw(W1); % function of LeSage
y=A(:,[7]); % column number in the data matrix that corresponds to the dependent variable
x=A(:,[1,2,3,4,5,6]); % 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=strvcat('logTC','intercept','logP','logA','logIND','logSV','logURB','logEI');
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
LMsarsem_panel(results,W,y,[xconstant x]); % (Robust) LM tests
% ----------------------------------------------------------------------------------------
% 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('logTC','intercept','logP','logA','logIND','logSV','logURB','logEI'); % should be changed if x is changed
prt_reg(results,vnames);
FE=meanny-meannx*results.beta; % including the constant term
yme = y - mean(y);
ee=ones(T,1);
error=y-kron(ee,FE)-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);
loglikfe=-nobs/2*log(2*pi*sige)-1/(2*sige)*results.resid'*results.resid
LMsarsem_panel(results,W,ywith,xwith); % (Robust) LM tests
model=2;
[ywith,xwith,meanny,meannx,meanty,meantx]=demean(y,x,N,T,model);
results=ols(ywith,xwith);
vnames=strvcat('logTC','intercept','logP','logA','logIND','logSV','logURB','logEI'); % should be changed if x is changed
prt_reg(results,vnames);
sige=results.sige*((nobs-K)/nobs);
loglikfe=-nobs/2*log(2*pi*sige)-1/(2*sige)*results.resid'*results.resid
LMsarsem_panel(results,W,ywith,xwith); % (Robust) LM tests
% ----------------------------------------------------------------------------------------
% spatial and time period fixed effects + (robust) LM tests for spatial lag and spatial error model
% fixed effects, within estimator
% demeaning of the y and x variables
model=3;
[ywith,xwith,meanny,meannx,meanty,meantx]=demean(y,x,N,T,model);
results=ols(ywith,xwith);
vnames=strvcat('logTC','intercept','logP','logA','logIND','logSV','logURB','logEI'); % should be changed if x is changed
prt_reg(results,vnames);
LMsarsem_panel(results,W,ywith,xwith); % (Robust) LM tests

二维码

扫码加我 拉你入群

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

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

关键词:model 空间面板 mode Mod del 模型 all 空间 面板 University

沙发
秋波散花 在职认证  发表于 2013-3-26 21:23:08
楼主在研究空间面板吧?研究怎么样了,我们交流下

藤椅
gssdzc 在职认证  发表于 2013-3-26 21:24:29
同样想知道

板凳
tulipsliu 在职认证  发表于 2013-3-26 22:17:28
model=2;
[ywith,xwith,meanny,meannx,meanty,meantx]=demean(y,x,N,T,model);

你打开 demean.m  这个文件里;
里面有函数的申明,
会介绍 model 参数是指定什么模型;

这个是 ELHOST  的程序代码;
仔细看看就可以
劳动经济学

匿名网友
报纸
匿名网友  发表于 2013-3-27 12:41:57
秋波散花 发表于 2013-3-26 21:23
楼主在研究空间面板吧?研究怎么样了,我们交流下
我也没有系统的学习,只是断断续续的研究。我的QQ号1145643926

地板
凹凸平原 在职认证  发表于 2013-3-27 12:42:27
tulipsliu 发表于 2013-3-26 22:17
model=2;
[ywith,xwith,meanny,meannx,meanty,meantx]=demean(y,x,N,T,model);
恩,好的,谢谢,我看看这个程序
你好像换头像了

7
凹凸平原 在职认证  发表于 2013-3-27 13:13:54
tulipsliu 发表于 2013-3-26 22:17
model=2;
[ywith,xwith,meanny,meannx,meanty,meantx]=demean(y,x,N,T,model);
还是没看明白是什么意思,你可以再指导我一下吗

8
彭艳琼 发表于 2013-3-29 16:27:29
请参考sar_panel_FE.m文件
%       info.model = 0 pooled model without fixed effects (default, x may contain an intercept)
%                  = 1 spatial fixed effects (x may not contain an intercept)
%                  = 2 time period fixed effects (x may not contain an intercept)
%                  = 3 spatial and time period fixed effects (x may not contain an intercept)

9
彭艳琼 发表于 2013-3-29 16:28:04
请参考sar_panel_FE.m文件
%       info.model = 0 pooled model without fixed effects (default, x may contain an intercept)
%                  = 1 spatial fixed effects (x may not contain an intercept)
%                  = 2 time period fixed effects (x may not contain an intercept)
%                  = 3 spatial and time period fixed effects (x may not contain an intercept)

10
凹凸平原 在职认证  发表于 2013-3-29 18:52:51
彭艳琼 发表于 2013-3-29 16:27
请参考sar_panel_FE.m文件
%       info.model = 0 pooled model without fixed effects (default, x may  ...
谢谢你 我明白了

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-10 13:49