matlab sac,空间计量模型SAC模型matlab代码,sac

编程入门 行业动态 更新时间:2024-10-09 22:22:02

matlab sac,空间计量<a href=https://www.elefans.com/category/jswz/34/1771358.html style=模型SAC模型matlab代码,sac"/>

matlab sac,空间计量模型SAC模型matlab代码,sac

dengjhui 发表于 2019-3-6 13:02

请问知道怎么用吗?就是如何加载自己的数据跟其他模型一样。

A=xlsread('D:\matlab\toolbox\SpatEcon_ren\Files_SLX_paper\cigarette.xls');

W1=xlsread('D:\matlab\toolbox\SpatEcon_ren\Files_SLX_paper\Spat-Sym-US.xls');

%

T=9; % number of time periods

N=31; % number of regions

% row-normalize W

W=normw(W1); % function of LeSage

y=A(:,1); % column number in the data matrix that corresponds to the dependent variable

x=A(:,[2,3,4,5,6,7,8,9]); % 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);           %size返回的是行和列

et=ones(T,1);

en=ones(N,1);

% All models include spatial and time period fixed effects

% SAC / SARAR / Clifford-Ord/ Kelejian-Prucha model

info.lflag=0; % required for exact results

info.model=3;

info.fe=0; % Do not print intercept and fixed effects; use info.fe=1 to turn on

info.bc=1;

results=sac_panel_FE(y,x,W,T,info);

vnames=strvcat('logcit','logp','logy');

prt_spnew(results,vnames,1);

% Print out effects estimates

spat_model=0;

direct_indirect_effects_estimates(results,W,spat_model);

更多推荐

matlab sac,空间计量模型SAC模型matlab代码,sac

本文发布于:2024-02-06 16:48:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1750537.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模型   代码   空间   matlab   sac

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!