Alias ArchiveArchive in progress
Archive in progress

Choosing a spatial weight matrix

Spatial methods02 / NOTE

Before any spatial test or model, you have to declare who counts as whose neighbour. The W matrix is that declaration — an assumption, not a fact handed over by the data.

Filed
Field
Research
Edition
EN / Reading copy
Video lesson · 01:37 Declare who counts as whose neighbour

Vera compares contiguity, distance-band, and k-nearest-neighbour constructions, showing that each W encodes a different spatial mechanism. The lesson establishes the choice logic before the note covers standardisation, asymmetry, and robustness checks.

English narration · 16:9Playback starts only when selected; it never autoplays.

The lesson compares common definitions of neighbourhood; theoretical justification and sensitivity checks remain in the full note.

Every spatial statistic — Moran’s I, a spatial lag, a spatial error term — rests on one prior decision: who is whose neighbour? The spatial weights matrix WW is where you answer it. It is an n×nn \times n matrix whose entry wijw_{ij} encodes how connected unit ii is to unit jj, with wii=0w_{ii}=0 by convention. Once fixed, the spatial lag WzWz is just the (weighted) average of each unit’s neighbours — the object every spatial method actually operates on.

The data do not hand you W. You choose its structure:

  • Contiguity. wij=1w_{ij}=1 if areas ii and jj share a border. Rook contiguity requires a shared edge; Queen also counts a shared corner (so more neighbours). Natural for areal units like districts or census tracts.
  • Distance band. wij=1w_{ij}=1 if the distance dijd_{ij} is within a cutoff δ\delta, else 0. Simple, but the cutoff is delicate: too small and some units become islands with no neighbours; too large and dense areas acquire enormous neighbour sets.
  • k-nearest-neighbours. Each unit links to its k closest others, guaranteeing exactly k neighbours everywhere. Robust when density is uneven (a crowded centre, a sparse edge), at the cost of being asymmetric by construction — i can be a neighbour of j without the reverse.

Then row-standardise: divide each row by its sum so jwij=1\sum_j w_{ij}=1. Now WzWz is a true average — comparable across units with different neighbour counts — and the spatial parameters (ρ\rho, λ\lambda) land in an interpretable, bounded range. This is standard for both Moran’s I and spatial regression.

The point to internalise: W is a modelling assumption, not a measurement. It is exogenous and pre-specified — you do not estimate it from the outcome y. And it has teeth: a denser W generally inflates measured autocorrelation, and a badly chosen W can flip the diagnostic tests that decide which spatial model you fit. So the discipline is:

  1. Pick a structure with a substantive rationale — why these neighbours?
  2. Fix it before looking at results, so you can’t tune W toward a wanted answer.
  3. Re-run the analysis over alternative W (different k, rook vs queen, other cutoffs) and report whether the conclusions survive.

If the story only holds for one hand-picked weighting, it is a story about your W, not about space.