I usually use Maurizio Pisati's package "sg162" to run spatial analysis in Stata; mainly the commands spatwmat to create the matrix and spatreg to conduct the spatial regression model.
I would like to move from Pisati's package to Stata's own resources for spatial autoregressive models (SAR). Apparently, I can do much more using Stata's build-in commands, such as conducting a SAR model combined with a spatial error model.
Using Pisati's package, all I need to conduct the SAR model is:
1. create the matrix based on my own file, as:
and
2. conduct the SAR model:
How can I replicate the above procedure using Stata's build-in commands such as spset and spreg?
Thanks!
I would like to move from Pisati's package to Stata's own resources for spatial autoregressive models (SAR). Apparently, I can do much more using Stata's build-in commands, such as conducting a SAR model combined with a spatial error model.
Using Pisati's package, all I need to conduct the SAR model is:
1. create the matrix based on my own file, as:
Code:
spatwmat using"~/Dropbox/matrix.dta", name(W) eigenval(E_W) standardize
2. conduct the SAR model:
Code:
spatreg dep_var $vars, weights(W) eigenval(E_W) model(lag)
Thanks!