楼主: cute三月
5325 8

[问答] 空间计量经济模型——sdm效应分解,matlab操作问题 [推广有奖]

  • 0关注
  • 0粉丝

大专生

15%

还不是VIP/贵宾

-

威望
0
论坛币
44 个
通用积分
3.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
804 点
帖子
13
精华
0
在线时间
66 小时
注册时间
2017-12-3
最后登录
2021-10-18

楼主
cute三月 发表于 2018-8-24 15:15:53 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
杜宾模型效应分解代码如下,
clear;
[A,name]=xlsread('alldata.xlsx');
W1=xlsread('weight.xlsx');
T=10; % number of time periods
N=31; % number of regions
% row-normalize W
w=normw(W1); % function of LeSage
y=A(:,[2]); % column number in the data matrix that corresponds to the dependent variable
x=A(:,[3,6,7,8]); % 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*T,1);
[nobs K]=size(x);
% ---------------------------------------------------------------------------------------

info.lflag=0; % required for exact results
info.model=1;
info.fe=0; % Do not print intercept and fixed effects; use info.fe=1 to turn on
results=sar_panel_FE(y,[x wx],w,T,info);
vnames=strvcat('y','csm','inc','price','urban','w*csm','w*inc','w*price','w*urban' );
prt_spnew(results,vnames,1)
% Print out effects estimates
spat_model=1;
direct_indirect_effects_estimates(results,w,spat_model);
panel_effects_sdm(results,vnames,w);
运行结果如下:
effect_separate_sdm

Pooled model with spatially lagged dependent variable and spatial fixed effects
Dependent Variable =          y      
R-squared          =    0.9408   
corr-squared       =    0.9238   
sigma^2            =    0.0300
Nobs,Nvar,#FE      =    310,     9,    39  
log-likelihood     =        75.723476
# of iterations    =      1   
min and max rho    =   -1.0000,   1.0000
total time in secs =    0.1730
time for optimiz   =    0.0060
time for lndet     =    0.0130
time for t-stats   =    0.0120
No lndet approximation used
***************************************************************
Variable        Coefficient  Asymptot t-stat    z-probability
csm               -0.132640        -4.087724         0.000044
inc                0.866986        13.211625         0.000000
price              2.067863         2.425411         0.015291
urban              1.479963        15.734717         0.000000
w*csm              0.121174         2.966329         0.003014
w*inc             -0.311179        -2.487223         0.012874
w*price           -0.965193        -0.468055         0.639745
w*urban           -0.950597        -5.605412         0.000000
W*dep.var.         0.398999         4.711590         0.000002

Undefined function 'direct_indirect_effects_estimates' for input arguments of type 'struct'.


Error in effect_separate_sdm (line 26)
direct_indirect_effects_estimates(results,w,spat_model);


请问有人可以帮忙解决吗?

二维码

扫码加我 拉你入群

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

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


沙发
cute三月 发表于 2018-8-24 17:57:46
已解决。少两个包。一个是旧版的sar_panel_FE
一个是elhost model文件

藤椅
黄騰騰 学生认证  发表于 2018-8-27 19:01:50
你好,我想问下运行sar-panel-fe这个m文件的时候,fieldnames那里可以运行得出来吗

板凳
cute三月 发表于 2018-9-27 23:19:58
黄騰騰 发表于 2018-8-27 19:01
你好,我想问下运行sar-panel-fe这个m文件的时候,fieldnames那里可以运行得出来吗
这个我还不是很精  我空间计量就学了几天 可能你要问一下大佬了

报纸
wowzhaopeng 学生认证  发表于 2018-11-14 10:11:52
您好  ,可以说一下您那两个包在哪里下载的吗   万分感激

地板
cute三月 发表于 2018-11-19 18:52:38
因为有其他人已经传过,我的传不了,你找一下

7
可乐可乐大可乐 发表于 2019-12-27 19:58:35
你好,我想问一下,这个z-probability 是p值吗,谢谢。

8
月微南 发表于 2020-4-24 21:41:37
cute三月 发表于 2018-8-24 17:57
已解决。少两个包。一个是旧版的sar_panel_FE
一个是elhost model文件
怎么下载哇楼主,给你币

9
公孙彦页 发表于 2021-1-3 19:06:16
可乐可乐大可乐 发表于 2019-12-27 19:58
你好,我想问一下,这个z-probability 是p值吗,谢谢。
对的,是P值

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-2-8 11:21