- Introduced by
- Luc Anselin
- Year
- 1988
- Type
- Spatial regression (cross-sectional)
What does it do?
Spatial regression is a family of regression models that build geographic neighbourhood relationships directly into the model.
It is formalised in Luc Anselin's 1988 treatment of spatial econometrics and has two main specifications: a spatial lag model, in which dependence enters through the dependent variable, and a spatial error model, in which it enters through the error term.
The intuition behind the method
Observations that are close in space often resemble each other, so ordinary regression, which treats observations as independent, can give misleading results when the data are tied to locations. Spatial regression records who is a neighbour of whom in a spatial weight matrix W and lets each observation be influenced by its neighbours. It does this either because the outcome itself spills over between nearby units (the lag form) or because unmeasured spatial factors carry across neighbours through the errors (the error form). Choosing between the two is a substantive claim about where the spatial dependence comes from.
History
The method is attributed to Luc Anselin's 1988 book Spatial Econometrics: Methods and Models. LeSage and Pace's 2009 Introduction to Spatial Econometrics presents regression methods for samples that violate the assumption of independence between observations.
When to use it
Choose spatial regression when observations have genuine geographic coordinates and a test of spatial autocorrelation, such as Moran's I applied to the residuals of an ordinary regression, indicates dependence that ordinary regression would ignore. Define the spatial weight matrix W before modelling and check the residuals again afterwards. A cross-sectional sample of roughly 50 units or more is a practical rule of thumb; smaller samples can make the maximum-likelihood estimates of the spatial parameters unstable. Choose the lag form when the outcome itself is expected to spill across neighbours, and the error form when unobserved spatial factors are the more plausible source of dependence. Do not use it when the units have no meaningful neighbourhood structure. The framework described here targets cross-sectional samples. For panel or repeated-observation data it does not apply directly; panel-fixed-effects covers panel methods, and spatial extensions of panel models are outside the scope of this page.
Limitations and considerations
- Depends on the spatial weight matrix W, which is fixed in advance; results can change with how neighbours are defined, and this is a modelling assumption rather than something the data determine.
- Observations need geographic coordinates, and the framework described here targets cross-sectional data.
- Maximum-likelihood estimation needs a reasonable sample; about 50 units is a practical rule of thumb, and smaller samples can make the spatial parameters unstable. Estimation is also more involved than ordinary least squares. In the lag form OLS is biased and inconsistent because Wy is correlated with the error term, so OLS cannot be used as a substitute for the spatial estimator.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Models geographic neighbourhood dependence explicitly, rather than assuming away the independence of observations that ordinary regression requires.
- Separates two distinct sources of spatial dependence, spillovers in the outcome (lag) and spatially correlated unobserved factors (error), each with its own interpretation.
- Builds on the spatial econometrics framework of Anselin, and LeSage and Pace's 2009 text presents regression methods for samples that violate the assumption of independence between observations.
Applications
- Modelling regional economic outcomes where nearby regions may influence one another.
- Analysing georeferenced outcomes in which a measured variable spills over between neighbouring areas (lag form).
- Controlling for spatially correlated unobserved factors that would otherwise make inference from ordinary regression unreliable (error form).
How it works
How it works
In the spatial lag model the outcome y depends on Wy, a spatially weighted average of neighbours' outcomes, scaled by the autoregressive parameter ρ, alongside the usual predictors Xβ and an error term. A non-zero ρ means the outcome at one location is shaped by outcomes at neighbouring locations. Because the outcome at a location feeds back through W to its neighbours and back again, Wy is correlated with the error term. This violates the exogeneity assumption behind ordinary least squares, so OLS is biased and inconsistent for this specification. Interpretation also differs from ordinary regression: in the lag model the coefficients β do not give the full effect of a predictor, because feedback through W changes outcomes at neighbouring units as well. Direct effects (on the unit itself) and indirect effects (spillovers to neighbours) must be computed from the model's reduced form. In the error model, λ is a correlation parameter for the disturbances and is not a spillover coefficient.
Formula
y = \rho W y + X\beta + \varepsilon
In the spatial error model the spatial dependence sits in the disturbances rather than in the outcome. The error term carries spatial correlation governed by the parameter λ and the matrix W, so the part of the outcome that the predictors do not capture is itself spatially structured. Both specifications are estimated by maximum likelihood. W must be fixed before estimation, typically from geographic coordinates (by distance or by nearest neighbours) or from contiguity such as shared borders. Its definition is a modelling assumption.
Formula
\varepsilon = \lambda W u + \xi
Common pitfalls
- Fitting a spatial model without first testing the residuals of an ordinary regression for spatial autocorrelation with Moran's I.
- Setting W arbitrarily, without checking whether the conclusions hold under alternative definitions of neighbours.
- Choosing the lag form when the dependence lies in the error term, or the reverse, since the two specifications imply different interpretations of the spatial parameter.
- Applying the model to units that have no genuine geographic coordinates or neighbourhood structure, where W has no substantive meaning.
Frequently asked questions
What is the difference between the spatial lag and spatial error models?
The spatial lag model places spatial dependence in the outcome: an observation's value depends on its neighbours' values through the term ρWy. The spatial error model places the dependence in the disturbances, so spatially correlated unobserved factors carry across neighbours through the parameter λ and the matrix W. The lag form captures spillovers in the outcome; the error form captures spatial structure in what the model leaves out.
What is the spatial weight matrix W?
W encodes the neighbourhood structure: which observations are considered neighbours of which, and how strongly. It must be defined before estimation, typically from geographic coordinates (for example contiguity or distance), and the model's results depend on this choice.
Why test with Moran's I first?
Moran's I tests for significant spatial autocorrelation in the data or the residuals. If none is found, ordinary regression may be adequate; if it is found, ignoring it can make ordinary regression misleading, and a spatial model is warranted.
How large a sample do I need?
A cross-sectional sample of roughly 50 georeferenced units or more is a practical rule of thumb; smaller samples can make the maximum-likelihood estimates of the spatial parameters unstable.
Related methods
Sources
Anselin, L. (1988). Spatial Econometrics: Methods and Models. Kluwer Academic Publishers.
Open DOI referenceLeSage, J. & Pace, R. K. (2009). Introduction to Spatial Econometrics. Chapman & Hall/CRC.
Open DOI referenceApplied Spatial Statistics and Econometrics Data Analysis in R by Katarzyna Kopczewska (2021), p. ?