Alias ArchiveArchive in progress
Archive in progress

Spatial dependence and spatial heterogeneity are not the same problem

Spatial methods01 / NOTE

Two different ways geography enters a regression — a neighbour effect versus a relationship that refuses to stay constant — and why the distinction dictates the whole modelling chain.

Filed
Field
Research
Edition
EN / Reading copy

Put geography into a regression and “space” almost never means one thing. It hides two different problems that demand different tools, and naming which one you have is the first real modelling decision — get it wrong and everything downstream is quietly invalid.

Two phenomena, not one

Spatial dependence is a property of the covariance of the data: an outcome, or the errors around it, are correlated across nearby units. Tobler’s first law — near things are more related than distant ones — is the informal version. You encode “nearby” in a spatial weights matrix WW (contiguity, distance bands, or k-nearest-neighbours, usually row-standardised) and then write one of two canonical models:

SAR:y=ρWy+Xβ+εSEM:y=Xβ+u,u=λWu+ε\begin{aligned} \mathrm{SAR:}\quad y &= \rho Wy + X\beta + \varepsilon \\ \mathrm{SEM:}\quad y &= X\beta + u,\qquad u = \lambda Wu + \varepsilon \end{aligned}

In the lag model the outcome itself spills over: my value responds to my neighbours’ values, with ρ\rho measuring the strength. Because yy sits on both sides, a shock anywhere propagates everywhere through the reduced form y=(IρW)1(Xβ+ε)y=(I-\rho W)^{-1}(X\beta+\varepsilon), so a covariate’s effect splits into a direct part and an indirect (spillover) part — the naïve β\beta is no longer the marginal effect. In the error model the spillover lives in omitted, spatially structured factors captured by λ\lambda; here the coefficients β\beta remain consistent under OLS, but the standard errors are wrong and inference is misleading.

The crucial point: in both, the relationship is global. One β\beta vector describes the whole map. Space lives in the covariance structure, not in the parameters.

Spatial heterogeneity is the opposite — the parameters themselves move across space:

yi=β0(ui,vi)+kβk(ui,vi)xki+εiy_i = \beta_0(u_i, v_i) + \sum_k \beta_k(u_i, v_i)x_{ki} + \varepsilon_i

where (ui,vi)(u_i, v_i) are the coordinates of observation ii. Geographically weighted regression (GWR) estimates a separate, kernel-weighted regression at every location — the bandwidth chosen by AICc or cross-validation — and returns a surface of local coefficients, one β\beta per place. There is no single “effect of X”; there is an effect-here and an effect-there. Space now lives in the parameters, not (only) in the covariance.

Telling them apart

  1. Fit a global OLS and look at the residuals.
  2. Moran’s I on those residuals tests for leftover spatial structure:
I=nS0eTWeeTeI = \frac{n}{S_0}\frac{e^{\mathsf T}We}{e^{\mathsf T}e}

A significant I says “space remains” — but it does not say which kind. Both dependence and unmodelled heterogeneity leave autocorrelated residuals, so Moran’s I is a smoke alarm, not a diagnosis. 3. To discriminate dependence, use the LM (Lagrange multiplier) tests and their robust variants (Anselin’s decision rule): the robust LM-error versus robust LM-lag statistic points you toward SEM or SAR. 4. To detect heterogeneity, ask a different question — does a global model misfit systematically across whole regions? Spatial-regime / Chow-type tests, an AICc improvement of GWR over the global fit, or a patchy local-R² surface are the tells.

Why the distinction is not pedantic

  • Model a genuinely varying relationship with a single lag term and you fold the misfit into ρ\rho, then report one averaged coefficient that is true nowhere.
  • Model merely neighbour-correlated errors with GWR and you let the coefficients wander to absorb noise, over-fitting a “heterogeneity” surface that is really an artefact.

And they co-occur. A relationship can vary across space and leave neighbour-correlated errors; then you need both — GWR with spatially robust inference, a spatially-varying-coefficient model, or MGWR when different covariates operate at different spatial scales.

The one-line test

Ask: is my neighbour’s value leaking into mine, or does the rule linking X to y change as I move across the map? The first is a covariance problem (spatial dependence); the second is a parameter problem (spatial heterogeneity). The entire modelling chain follows from which answer is yes.