|
2.空间计量模型代码
代码---w1
bysort id:gen n=_n
replace x1=ln(1+x1)
replace x2=ln(1+x2)
replace x3=ln(1+x3)
replace x4=ln(1+x4)
replace x5=ln(1+x5)
replace x6=ln(1+x6)
replace x7=ln(1+x7)
save "G:\公众号:久菜盒子工作室\2022年10月\8.咎巷-800-空间向量结果函数\2.数据-w\stata数据.dta"
cd G:\公众号:久菜盒子工作室\2022年10月\8.咎巷-800-空间向量结果函数\2.数据-w
clear
set matsize 5000
use w
spcs2xt A-AD ,matrix(w1)time(20)
spatwmat using w1xt,name(w1) standardize
use stata数据
reg y x1 x2 x3 x4 x5 x6 x7
spatdiag,weights(w1)
w2
use juliw2
spcs2xt A-AD ,matrix(w2)time(20)
spatwmat using w2xt,name(w2) standardize
use stata数据
reg y x1 x2 x3 x4 x5 x6 x7
spatdiag,weights(w2)
w3
use qiantaow3
spcs2xt A-AD ,matrix(w3)time(20)
spatwmat using w3xt,name(w3) standardize
use stata数据
reg y x1 x2 x3 x4 x5 x6 x7
spatdiag,weights(w3)
*基于不同空间权重矩阵的SDM模型估计结果
*重新设立矩阵-Wald检验
spatwmat using w.dta,name(w11)
spatwmat using w.dta,name(w11) standardize
xsmle y x1 x2 x3 x4 x5 x6 x7 , fe model(sdm) wmat(w11) nolog effects type(both)
test x1 = x2 = x3 = x4 = x5 = x6 = x7
spatwmat using juliw2.dta,name(w22)
spatwmat using juliw2.dta,name(w22) standardize
xsmle y x1 x2 x3 x4 x5 x6 x7 , fe model(sdm) wmat(w22) nolog effects type(both)
test x1 = x2 = x3 = x4 = x5 = x6 = x7
spatwmat using qiantaow3.dta,name(w33)
spatwmat using qiantaow3.dta,name(w33) standardize
xsmle y x1 x2 x3 x4 x5 x6 x7 , fe model(sdm) wmat(w33) nolog effects type(both)
test x1 = x2 = x3 = x4 = x5 = x6 = x7
*基于不同空间权重矩阵的SDM模型估计结果
******************************************************************************
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w11) nolog type(time)
est store m1
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w11) nolog type( ind)
est store m2
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w11) nolog type(both)
est store m3
esttab m1 m2 m3 using w1空间计量.rtf,replace stats(N r2_a) star(* 0.1 ** 0.05 *** 0.01) se ar2
***************************************************************************
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w22) nolog type(time)
est store m1
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w22) nolog type( ind)
est store m2
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w22) nolog type(both)
est store m3
esttab m1 m2 m3 using w2空间计量.rtf,replace stats(N r2_a) star(* 0.1 ** 0.05 *** 0.01) se ar2
*****************************************************************************************
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w33) nolog type(time)
est store m1
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w33) nolog type(ind)
est store m2
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w33) nolog type(both)
est store m3
esttab m1 m2 m3 using w3空间计量.rtf,replace stats(N r2_a) star(* 0.1 ** 0.05 *** 0.01) se ar2
***************************************************************************************
|