I want to create a spatial lag matrix in stata in order to do a spatial lag model. I am a beginner for econometric analysis.
Specifically, I want to create a spatial lag matrix for use in the SSA (Sub-Saharan Africa) country panel data.
Currently I have latitude and longitude information for the lag matrix.
I have found some methods on the internet, such as using Mata, but I did not understand them well.
. spgenerate W_x = W*xcntrd
but it displayed "data not spset".
Specifically, I want to create a spatial lag matrix for use in the SSA (Sub-Saharan Africa) country panel data.
Currently I have latitude and longitude information for the lag matrix.
I have found some methods on the internet, such as using Mata, but I did not understand them well.
. spgenerate W_x = W*xcntrd
but it displayed "data not spset".
Comment