15 YouTube views, likes subscribers in 10 minutes. Free!
Get Free YouTube Subscribers, Views and Likes

How to Estimate Spatial Panel Data Models in Stata

Follow
Diogo Tomé

Tutorial on how to estimate Spatial Panel Data Models in Stata using the xsmle command.

The spatial weights matrix is generated in GeoDa then imported into Stata using the spwmatrix and the spmat commands.

The spatial weights matrix is used to model the form of the spatial lags and spatial autocorrelation.

There is spatial autocorrelation when spatial observations closer to each other are more similar than observations that are farther apart. This similarity is a crucial assumption in spatial econometrics.
You can use the Moran’s I and LISA statistics (easily performed in GeoDa) to test for the presence of neighbourhood effects (spatial autocorrelation) and spatial clusters.
Another way to see if there is evidence of spatial effects is to look at the spatial dependence factors (given by the Spatial Rho, Spatial Lambda and Spatial Phi, depending on the model considered) of the spatial regressions.

Depending on the spatial model, we can have a spatially lagged dependent variable, spatially lagged independent variables and spatial autoregressive error terms.

Spatial Panel Models estimated:
SpatialAutoRegressive model (SAR)
The SAR is a spatial lag model, because the dependent variable is spatially lagged.
Spatial error model (SEM)
The SEM is a spatial error model, because it incorporates a spatially autoregressive process in the error term.
SpatialAutoregressive with Spatially Autocorrelated Errors model (SAC / SARAR / KelejianPrucha)
The SAC is a combination of both the interaction among the dependent variable and the interaction among the error terms.
Spatial Durbin Model model (SDM)
The SDM is a generalization of the SAR in which spatially lagged independent variables are also included as explanatory variables.
Generalised Spatial Random Effects model (GSPRE)
The GSPRE is a generalization of the SEM in which the (a vector of parameters representing the panel effects) is spatially correlated.

In the video I also show a quick way to transform your data into the panel data format.

– Links –

Material used:
https://drive.google.com/drive/folder...
Merge Tables Wizard addin for Excel:
https://www.ablebits.com/downloads/in...
(A way faster alternative to using this addin is to select your table and sort the data (Data tab Sort) by spatial unit!)
Paper "Spatial panel data models using Stata" (2017):
http://www.research.ed.ac.uk/portal/f...

posted by chantesiesis