use spatialdata_province.dta,clear
spwmatrix gecon x_stub y_stub , wn(spatialweight_province) wtype(inv) cart alpha(1) <br>
xport(spatialweight_province,txt) row replace \\生成名为 spatialweight_province 的权重矩阵
spmat import spatialweight_province using spatialdata_province.txt,replace \\导入 spatialweight_province 权重矩阵<br>
<br>
spmat save spatialweight_province using spatialweight_pro.spmat,replace //将生成的 spmat 权重文件存储为spatialweight_pro
spmat use spatialweight_pro using spatialweight_pro.spmat,replace //打开 spmat 权重文件
matrix list spatialweight_pro //查看 spatialweight_pro 权重矩阵