- Introduced by
- Delgado & Florax
- Year
- 2015
- Type
- Quasi-experimental estimator
- Family
- Spatial causal inference
What does it do?
Spatial Difference-in-Differences (Spatial DiD) extends the classical DiD regression to geo-referenced panels in which outcomes may be spatially dependent or affected by spillovers between neighbouring units.
The framework is associated with Delgado and Florax (2015) and adds a spatial lag term (rho*W*y) to a two-way fixed-effects DiD specification. It is relevant to settings such as infrastructure investment, environmental regulation, or zoning reform, where a policy in one location may also affect its neighbours.
The intuition behind the method
Classic DiD compares treated and untreated units before and after a policy change, assuming the two groups would have evolved in parallel without the intervention. The standard design also assumes no interference, meaning one unit's treatment does not affect another unit's outcome. When units are cities, counties, or grid cells, a policy affecting one location can spill into its neighbours, which may contaminate the control group and bias the comparison. Spatial DiD relaxes the no-interference assumption only through the modelled spatial structure: a spatial-weight matrix inside the regression captures cross-unit dependence rather than ignoring it. Control units must still be defined with explicit assumptions about how far, and through which channels, spillovers travel, and the choice of W encodes those assumptions. The coefficient delta on the treatment-by-period interaction is the treatment term of the model. When rho is non-zero, reading delta as a direct local effect requires a decomposition of total effects, because spatial feedback means the raw coefficient does not by itself give the full impact. The spatial parameter rho measures how strongly outcomes in one unit track outcomes in its weighted neighbours.
History
Spatial DiD is associated with Delgado and Florax (2015), published in Economics Letters under the title 'Difference-in-differences techniques for spatial data: Local autocorrelation and spatial interaction'. The paper addresses difference-in-differences estimation for spatial data, with attention to local autocorrelation and spatial interaction. Readers should consult the original article for its exact model specification and results.
When to use it
Use Spatial DiD when you have a panel of geo-referenced units, a clearly defined treatment group exposed to a policy shock, and a substantive reason to expect spillovers or spatial dependence in outcomes. The method requires that parallel trends hold after accounting for spatial dependence, and that the spatial weight matrix be specified in advance on substantive grounds. It is not appropriate when treatment assignment is random without spatial structure, or when the number of geographic units is too small for reliable estimation of the spatial parameter. When pre-treatment trends diverge sharply, synthetic control or matching-based DiD designs are generally preferable.
Limitations and considerations
- The spatial weight matrix must be pre-specified, and the estimates can be sensitive to how W is constructed
- Consistent estimation requires maximum likelihood or IV/GMM, which are more computationally demanding and less transparent than OLS
- Parallel trends must hold conditionally on spatial dependence, which is harder to verify and defend than in the aspatial case
- With few geographic units, the spatial-parameter estimates are imprecise and the diagnostic tests have low power
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Models spatial dependence that would otherwise distort the treatment estimate and its standard errors in a conventional DiD regression
- The framework is intended to distinguish direct and indirect effects, which can inform conclusions about the geographic reach of a policy, provided the decomposition is derived from the estimated model
- The model keeps the unit and time fixed effects of the standard two-way DiD specification, so the familiar identification logic is retained
- LM diagnostic tests give a formal, data-based basis for choosing between spatial-lag and spatial-error specifications
Applications
- Estimating the local and spillover employment effects of enterprise zone designations on surrounding labour markets
- Evaluating how a pollution regulation in one county affects air quality and health outcomes in neighbouring counties
- Estimating the effect of changes in public transit systems on house prices in treated areas relative to comparison areas, as in the spatial DiD estimator of Dubé et al. (2014)
- Assessing whether school-district consolidation in treated areas improves or displaces educational attainment in adjacent districts
- Analysing the spatial reach of agricultural subsidy reforms on land use and crop-choice decisions across contiguous farming regions
How it works
How it works
The n-by-n matrix W encodes geographic relationships among units. The model requires non-negative weights with a zero diagonal, and off-diagonal entries are positive when two units are treated as neighbours. Common constructions are contiguity for areal data and inverse-distance weights for point data. The choice should follow the hypothesised spillover mechanism rather than fit to the data. Row-standardisation is a common convention but is not fixed by the model formula, so it should be stated and justified separately.
Formula
\mathbf{W} \in \mathbb{R}^{n \times n},\quad w_{ij} \geq 0,\quad w_{ii} = 0The regression adds the spatial lag term rho*W*y to the standard DiD equation, which already contains unit fixed effects mu_i, time fixed effects lambda_t, covariates x, and the treatment interaction D*T with coefficient delta. The parameter rho measures how strongly the outcome in one unit depends on outcomes in its weighted neighbours. Because W*y is endogenous when rho is non-zero, OLS is inconsistent in this setting. Maximum likelihood or IV/GMM estimation is the standard alternative.
Formula
y_{it} = \alpha + \delta (D_i \cdot T_t) + \rho \mathbf{W} y_{it} + \mathbf{x}_{it}^{\top} \boldsymbol{\beta} + \mu_i + \lambda_t + \varepsilon_{it}When rho is non-zero, the treatment effect is entangled with spatial feedback: a change in treatment in one unit moves outcomes in its neighbours, which in turn feed back into the unit itself. Under this feedback, the coefficient on the treatment interaction is not the same as the total effect of the policy, and naive OLS estimates of delta can be distorted. Separating direct effects on treated units from indirect effects transmitted to neighbours requires a decomposition of the estimated spatial model. Reported direct and indirect estimates should be derived from that decomposition rather than read from the raw coefficient.
Formula
\hat{\delta}_{\text{spatial}} = \hat{\delta}_{\text{OLS}} - \rho \sum_{j \neq i} w_{ij} \hat{\delta}_jBefore choosing a specification, Lagrange multiplier tests for spatial lag and spatial error dependence are computed from the residuals of an OLS DiD model. Robust variants of the tests help when both are significant. If neither test is significant, a standard DiD may be adequate. If the lag test dominates, a spatial-lag specification is indicated, as described above. If the error test dominates, a spatial-error model is indicated. That model is not set out here and requires a dedicated spatial econometrics reference before estimation.
Formula
LM_{\text{lag}} = \frac{[\mathbf{e}^{\top} \mathbf{W} \mathbf{y} / \hat{\sigma}^2]^2}{J},\quad LM_{\text{err}} = \frac{[\mathbf{e}^{\top} \mathbf{W} \mathbf{e} / \hat{\sigma}^2]^2}{\text{tr}[(\mathbf{W}+\mathbf{W}^{\top})\mathbf{W}]}Common pitfalls
- Choosing the weight matrix after inspecting results increases the risk of specification search and can make nominal inference unreliable
- Treating spillover-affected control units as clean controls without modelling the spatial structure biases the treatment estimate, and the direction of that bias depends on the sign of the spillover, so it should not be assumed
- Estimating a model with a spatial lag by OLS yields inconsistent estimates because W*y is endogenous; use maximum likelihood or IV/GMM
- Reading a significant rho as evidence of causal spillovers is a mistake, because rho captures dependence of any origin, including omitted common shocks
Frequently asked questions
How do I choose the spatial weight matrix?
The weight matrix should reflect the hypothesised mechanism through which outcomes in one unit influence outcomes in another. Contiguity is a common choice for administrative areas that share borders, and distance-based weights suit continuous geographic processes. The choice should be justified on substantive grounds before estimation. Because results can depend on W, it is good practice to report sensitivity analyses with alternative matrices.
Can Spatial DiD handle staggered treatment timing?
It can be attempted, but it adds complexity. No standard spatial extension of heterogeneous-timing DiD estimators is widely established, so combining spatial terms with staggered adoption requires a custom specification. Useful checks include event-study plots of pre-treatment trends by adoption cohort and a comparison of results with and without the spatial term. Heterogeneous-timing estimators can be applied to the non-spatial part of the model, but the spatial extension must be validated separately.
What software can estimate Spatial DiD?
Software for maximum-likelihood spatial lag models exists in several statistical environments, and general DiD tools can be used for the fixed-effects structure. Not every package can estimate the exact DiD specification with a spatial lag and interaction term, so confirm this in the documentation before use, and check the estimates against a hand-coded likelihood or a known benchmark where possible.
Related methods
Sources
Delgado, M. S., & Florax, R. J. G. M. (2015). Difference-in-differences techniques for spatial data: Local autocorrelation and spatial interaction. Economics Letters, 126, 35–40.
Open DOI referenceKopczewska, K. (2021). Applied Spatial Statistics and Econometrics: Data Analysis in R, reference list entry for Dubé, Legros, Thériault, & Des Rosiers (2014), p. not recorded