在使用空间计量模型研究相关问题时,空间权重矩阵起着非常重要的作用。经典的空间权重矩阵有:邻接矩阵、地理距离矩阵。在ASE微信公众号上已经推送过如何采用Stata生成上述两种空间权重矩阵的文章,感兴趣的朋友可以查阅。
今天与各位感兴趣的朋友一起学习如何使用Stata生成经济距离空间权重矩阵。下面给出生成该矩阵的Stata代码。
Generate an economic distance spatial weights matrix using unemployment as the economic variable(以失业作为经济变量生成经济距离空间权重矩阵)
. use 34_provinces2004_lon&lat,clear
. spwmatrix gecon latitude longitude, wn(wecon) wtype(econ) econvar(unemployment) rowstand
. clear
. svmat wecon
. save wecon
Focuses on the setting and application of spatial econometric models, and commits to promote the development of Spatial Econometrics in China.