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 W is where you answer it. It is an n × n matrix whose entry w_ij encodes how connected unit i is to unit j, with w_ii = 0 by convention. Once fixed, the spatial lag Wz 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.
w_ij = 1if areasiandjshare 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.
w_ij = 1if the distanced_ijis within a cutoffδ, 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
kclosest others, guaranteeing exactlykneighbours everywhere. Robust when density is uneven (a crowded centre, a sparse edge), at the cost of being asymmetric by construction —ican be a neighbour ofjwithout the reverse.
Then row-standardise: divide each row by its sum so Σ_j w_ij = 1. Now Wz is a true average — comparable across units with different neighbour counts — and the spatial parameters (ρ, λ) 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:
- Pick a structure with a substantive rationale — why these neighbours?
- Fix it before looking at results, so you can’t tune
Wtoward a wanted answer. - Re-run the analysis over alternative
W(differentk, 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.