-
大小: 6KB文件類型: .rar金幣: 2下載: 1 次發(fā)布日期: 2021-06-28
- 語言: Matlab
- 標(biāo)簽:
資源簡介
用到空間杜賓模型SDM,由于jplv7包中的原有的SDM模型只能分析截面數(shù)據(jù),而做面板數(shù)據(jù)需要jplv7的panel里面給出的SAR模型再自己改編,難度很高。該工具箱是已經(jīng)直接可以做面板的SDM代碼,當(dāng)然,也可以做SAR,SER等空間計量模型,非jplv7的原始版本(Elhorst在此基礎(chǔ)上的修改),套用這個代碼,做空間計量模型(SDM,SAR,SEM),除了可以得到模型系數(shù)估計值,還可以計算自變量對因變量的直接效應(yīng)和間接效應(yīng)。

代碼片段和文件信息
%?Demonstration?file?for?Elhorst?Panel?Data?code
%
%?Dataset?downloaded?from?www.wiley.co.uk/baltagi/
%?Spatial?weights?matrix?constructed?by?Elhorst
%
%?written?by:?J.Paul?Elhorst?summer?2010
%?University?of?Groningen
%?Department?of?Economics
%?9700AV?Groningen
%?the?Netherlands
%?j.p.elhorst@rug.nl
%
%?REFERENCE:?
%?Elhorst?JP?(2010)?Matlab?Software?for?Spatial?Panels.?Under?review.
%
%?Elhorst?JP?(2010)?Spatial?Panel?Data?Models.?In?Fischer?MM?Getis?A?(Eds.)?
%?Handbook?of?Applied?Spatial?Analysis?Ch.?C.2.?Springer:?Berlin?Heidelberg?New?York.
%
%?New:
%?1)?Direct/Indirect?effect?esimates?of?the?explanatory?variables
%?LeSage?JP?Pace?RK?(2009)?Introduction?to?Spatial?Econometrics.?Boca?Raton?Taylor?&?Francis?Group.
%?routine?direct_indirect_effects_estimates(resultsWspat_model)?is?written?by?J.P.?Elhorst
%?routines?panel_effects_sar(resultsvnamesW)?and?panel_effects_sar(resultsvnamesW)?
%?are?written?and?made?available?by?D.?Lacombe
%?User?may?use?both?routines?(note:?results?are?slightly?different?from?each?other?since?they?are?based?on?draws?from?a?distrobution?
%?or?choose?one?particular?routine.?If?N?is?large?user?should?choose
%?Lacombe‘s?routines?since?this?one?is?much?more?efficient?computationally
%?2)?Bias?correction?of?coefficient?estimates
%?Lee?Lf?Yu?J.?(2010)?Estimation?of?spatial?autoregressive?models?with
%?fixed?effects?Journal?of?Econometrics?154:?165-185.
%?3)?Selection?framework?to?determine?which?spatial?panel?data?model?best
%?describes?the?data.
%?dimensions?of?the?problem
A=wk1read(‘x:\lotus\cigarette.wk1‘10);
W1=wk1read(‘x:\lotus\Spat-Sym-US.wk1‘);
T=30;?%?number?of?time?periods
N=46;?%?number?of?regions
%?row-normalize?W
W=normw(W1);?%?function?of?LeSage
y=A(:[3]);?%?column?number?in?the?data?matrix?that?corresponds?to?the?dependent?variable
x=A(:[46]);?%?column?numbers?in?the?data?matrix?that?correspond?to?the?independent?variables
for?t=1:T
????t1=(t-1)*N+1;t2=t*N;
????wx(t1:t2:)=W*x(t1:t2:);
end
xconstant=ones(N*T1);
[nobs?K]=size(x);
%?----------------------------------------------------------------------------------------
%?No?fixed?effects?+?spatially?lagged?dependent?variable
info.lflag=0;?%?required?for?exact?results
info.model=0;
info.fe=0;?%?Do?not?print?intercept?and?fixed?effects;?use?info.fe=1?to?turn?on
%?New?routines?to?calculate?effects?estimates
results=sar_panel_FE(y[xconstant?x]WTinfo);?
vnames=strvcat(‘logcit‘‘intercept‘‘logp‘‘logy‘);
%?Print?out?coefficient?estimates
prt_sp(resultsvnames1);
%?Print?out?effects?estimates
spat_model=0;
direct_indirect_effects_estimates(resultsWspat_model);
panel_effects_sar(resultsvnamesW);
%?----------------------------------------------------------------------------------------
%?No?fixed?effects?+?spatially?lagged?dependent?variable?+?spatially
%?independent?variables
info.lflag=0;?%?required?for?exact?results
info.model=0;
info.fe=0;?%?Do?not?print?interc
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????13818??2013-10-01?20:46??demopanelscompare.m
?????文件???????3638??2013-10-01?20:41??direct_indirect_effects_estimates.m
?????文件???????1827??2013-10-01?20:40??f2_sarpanel.m
?????文件???????1917??2013-10-01?20:39??f_sarpanel.m
?????文件???????1917??2013-10-01?20:39??sar_panel_FE.m
-----------?---------??----------?-----??----
????????????????23117????????????????????5
- 上一篇:MATLAB數(shù)學(xué)建模工具箱
- 下一篇:小波變換模極大值去噪
評論
共有 條評論