Spatial Statistics
It treats location as part of the data: nearby places tend to be more alike than distant ones. Eleven parts, in geolattice.spatial_statistics, run from that idea to applied studies.
Spatial Statistics. This notebook, then Core Theoretical Concepts (Tobler’s law, stationarity, the modifiable areal unit problem, complete spatial randomness, and spatial weights) and Module Map, Architecture, and Learning Paths.
Point Patterns Analysis. Asks whether events are clustered, dispersed, or random, and maps their intensity.
Spatial Autocorrelation. Tests whether nearby places share similar values.
Spatial Regression. Models an outcome when neighbours affect one another.
Spatial Cluster Aanalysis. Finds statistically significant hotspots.
Disease Mapping and Bayesian Smoothing. Smooths rates for rare events and shows the uncertainty.
Geographically Weighted Models. Lets a relationship change from place to place.
Spatial Interpolation. Estimates values between sample points, and moves values between zone systems.
Spatial Sampling and Design. Chooses where to sample and where to place a monitoring network.
Spatial-Temporal Analysis. Follows weights, hotspots, density, interpolation, and regression through time.
Capstones:
Spatial Patterns, Socioeconomic Determinants, and Geographic Inequalities in Health Outcomes Across U.S. Counties,
Capstone: Presidential Voting Patterns, 2020 vs 2024 - Persistence and Shift,
Drug Overdose Mortality - Rate vs Model Rate, and Geographically Weighted Models,
Spatiotemporal Patterns, Hotspots, and Predictors of Crime Across NYC Police Precincts, and
Spatial Inequality and Economic Deprivation in the United States. Five studies that apply the methods.
Library: geolattice.spatial_statistics
Overview
By the end of this chapter you should be able to:
| Goal | Why it matters |
|---|---|
| Define spatial statistics in contrast to classical statistics | So you know when ordinary OLS, \(t\)-tests, and i.i.d. assumptions break |
| Name the four ways geographic data violate classical assumptions | Dependence, scale, support, and a geographic null |
| Match a spatial question to one of the nine Module 04 parts | So you can navigate Parts 1–9 without reading every notebook first |
| Recognise the application domains where these methods are indispensable | Epidemiology, environment, urban policy, ecology, and more |
Theory (weights, CSR, MAUP) is deferred to Chapter 0.2. Installation, the geolattice.spatial_statistics package map, and suggested learning paths live in Chapter 0.3.
What Is Spatial Statistics?
Spatial statistics studies phenomena that vary over geographic space with methods that incorporate location, proximity, and spatial structure. The discipline sits at the intersection of probability theory, geostatistics, econometrics, and computational geography.
Classical statistics asks: given a sample, what can we say about a population? Spatial statistics asks an additional question: given that the sample is arranged in space, how does that arrangement change what we can say? The answer is not cosmetic. When neighbouring counties share climate, policy, and demographics, their residuals are correlated; treating them as independent observations invents degrees of freedom that do not exist.
Four ways spatial data differ from classical data
| Difference | Classical assumption | Spatial reality | Consequence of ignoring it |
|---|---|---|---|
| Dependence | Observations are independent | Nearby units share similar values | Inflated significance; biased coefficients when spillovers exist |
| Scale | The unit of analysis is given | Results change with aggregation level (MAUP) | Correlations and model fit that are artefacts of zoning |
| Support | All observations have the same geometric form | Points ≠ areas ≠ continuous fields | Wrong likelihood, wrong null, wrong visualisation |
| Null model | “No difference” or “zero slope” | Complete Spatial Randomness (homogeneous Poisson process) | Pattern declared significant (or not) against the wrong baseline |
Working definition
Spatial statistics is the set of models, estimators, and tests in which location enters the likelihood, the covariance, or the sampling design, not merely the map legend.
That definition covers point processes (crime locations), lattice/areal models (county diabetes rates), geostatistical fields (PM2.5 at monitors), and space–time extensions of all three. It deliberately excludes pure cartography: a choropleth without a model is visualisation, not spatial statistics.
Why Spatial Statistics Matters
Ignoring spatial structure produces measurable harm. Four failure modes recur across applied work:
Inflated significance
Spatially autocorrelated residuals shrink estimated standard errors. A regression that reports \(p < 0.01\) under OLS may be non-significant once a spatial lag or spatial error term is included. Policy that reacts to false discoveries wastes resources and erodes trust.
Biased coefficients
When the dependence is substantive—one area’s outcome spills over into its neighbours—omitting that structure biases every coefficient, not just the standard errors. Housing prices, disease prevalence, and voting returns routinely exhibit this form of dependence.
Misleading maps
Raw small-area rates for rare events are dominated by sampling noise. A county of 2,000 people with two cancer cases looks like a crisis; a county of two million with the same rate looks unremarkable. Without empirical Bayes or hierarchical smoothing, maps point to spurious hotspots and drive wasteful allocation.
Missed heterogeneity
A single global coefficient can conceal the regions most in need of intervention. The effect of poverty on diabetes may be strong in rural counties and weak in dense metros. Geographically weighted and multiscale models exist precisely to recover that variation.
Application domains
| Domain | Typical spatial question |
|---|---|
| Epidemiology / public health | Cluster detection, disease mapping, access to care |
| Criminology | Hotspot policing, patrol optimisation |
| Environmental science | Air/water quality interpolation, exposure assessment |
| Urban planning | Housing-price gradients, neighbourhood effects |
| Agriculture | Yield mapping, precision-fertiliser placement |
| Ecology | Species distribution models, habitat connectivity |
| Economics | Spatial spillovers, market-area definition |
| Climate science | Temperature/precipitation field reconstruction |
If your data have coordinates, polygons, or monitoring locations, at least one of these questions is already on the table—whether or not the analysis has acknowledged it.
The Nine Driving Questions
Module 04 is organised around the questions practitioners actually ask. Each question maps to a Part, a data support, and a family of methods.
| Question | Example | Part |
|---|---|---|
| Pattern — Are events clustered, dispersed, or random? | Is crime concentrated in specific city blocks? | Part 1 · Point Pattern Analysis |
| Dependence — Do nearby places share similar values? | Do counties with high diabetes rates border each other? | Part 2 · Spatial Autocorrelation |
| Process — What drives a spatially varying outcome? | Which socio-economic factors predict county-level disease? | Part 3 · Spatial Regression |
| Cluster — Where are statistically significant concentrations? | Which neighbourhoods are hotspots? | Part 4 · Spatial Cluster Analysis |
| Mapping — How do we produce reliable, uncertainty-aware maps for rare events? | Disease rates in small counties are noisy—how do we smooth them? | Part 5 · Disease Mapping |
| Heterogeneity — Do relationships vary in space? | Is the effect of poverty on disease stronger in rural areas? | Part 6 · Geographically Weighted Models |
| Prediction — Can we estimate values at unsampled locations? | What is PM2.5 between air-quality monitors? | Part 7 · Interpolation |
| Design — How do we sample space efficiently? | Optimal monitor placement for a national survey? | Part 8 · Spatial Sampling |
| Dynamics — How do patterns evolve through time? | How do emerging hotspots shift year to year? | Part 9 · Spatio-Temporal Analysis |
You do not need all nine Parts. Chapter 0.3 gives role-based learning paths (epidemiology, environment, urban/policy, full foundations) so you can jump to the Parts that match your goal.
How the questions relate
Pattern (points) ──► Dependence (lattice) ──► Process (regression)
│ │ │
│ ▼ ▼
│ Cluster / Hotspots Disease Mapping
│ │ │
▼ ▼ ▼
Interpolation ◄──── Heterogeneity (GWR) ◄─────────┘
│
▼
Sampling Design ──► Spatio-Temporal (uses all of the above)
Parts 1–3 form the natural exploratory → confirmatory spine. Parts 4–6 specialise that spine for hotspot detection, small-area rates, and local coefficients. Parts 7–8 address continuous fields and design. Part 9 lifts everything into the space–time cube.
What You Will Build Toward
Across Module 04 you will:
- Test point patterns against Complete Spatial Randomness and quantify clustering with \(K\), \(L\), \(G\), \(F\), and \(J\).
- Construct spatial weights, compute global and local Moran statistics, and read LISA cluster maps.
- Diagnose why OLS fails on areal data and select among SLM, SEM, SDM, and related specifications.
- Detect hotspots with Getis-Ord \(G_i^*\), scan statistics, and regionalisation algorithms.
- Smooth small-area disease rates with empirical Bayes and BYM models.
- Fit geographically weighted and multiscale regressions when relationships vary in space.
- Interpolate continuous fields with IDW, RBF, and kriging, including validation.
- Design spatially balanced samples (BAS, GRTS) and evaluate monitoring networks.
- Extend selected methods into space–time weights, emerging hotspots, and panel models.
Chapter 0.2 supplies the theoretical vocabulary shared by all of those Parts. Chapter 0.3 shows how the library is organised and which notebooks to open first.
Next: Open 04_00_02_core_theoretical_concepts.ipynb for Tobler’s First Law, the three spatial data types, stationarity, MAUP, Complete Spatial Randomness, and spatial weights.
Installation. This notebook needs installation option 1 (vector, raster, CRS and visualization): pip install "geolattice[core]". See “Installation options” in the GeoLattice README.