There is a moment in every GIS career when the maps stop being enough. You plot crime incidents and see what looks like a cluster. You map disease cases and the eye finds a pattern. But a colleague, or worse, a skeptical journalist, asks the uncomfortable question: how do you know that pattern is real, and not just a trick of the eye? That question is the doorway to spatial statistics.
After thirty years of building maps and defending them in front of engineers, scientists and elected officials, I can tell you that this is the area that most separates casual map-makers from true spatial analysts. It’s also one of the most rewarding to learn. This guide will take you through it in plain language, with the concepts first and the formulas kept to a minimum.

What Are Spatial Statistics?
Spatial statistics is the branch of statistics that deals with data tied to location, where the position of observations affects how they relate to each other. It extends classical statistics, which usually assumes that observations are independent, to the real world, where observations near each other tend to resemble each other.
This idea has a name. Tobler’s First Law of Geography says that everything is related to everything else, but near things are more related than distant things. The tendency of nearby values to be similar is called spatial autocorrelation, and it’s the central concept of this entire field.
Why does it matter? Because ordinary statistics applied blindly to spatial data can give misleading results. If neighboring areas are alike, your data contains less independent information than you think, and your confidence in the findings may be exaggerated.
Spatial Statistics vs. Basic Spatial Analysis
These two are often confused, so let me draw the line clearly.
- Basic spatial analysis (buffers, overlays, queries) answers questions with geometry. It tells you what is within what. There is no notion of probability.
- Spatial statistics answers questions with inference. It tells you whether a pattern is statistically significant, meaning unlikely to have arisen by chance, and it quantifies relationships and uncertainty.
A buffer can show which houses lie near a factory. Spatial statistics can tell you whether illness rates near the factory are significantly higher than expected.
The Concepts You Must Know
Spatial Autocorrelation
Imagine mapping house prices. Expensive houses tend to be near other expensive houses; cheap ones near cheap ones. That is positive spatial autocorrelation. If, strangely, high values were systematically surrounded by low ones, like a chessboard, you’d have negative spatial autocorrelation. If values are scattered with no relation to location, you have randomness.
Spatial Weights and Neighborhoods
To measure how locations influence each other, you must first define who counts as a neighbor. This is done with a spatial weights matrix. Common choices:
- Contiguity: neighbors share a border (rook) or a border or corner (queen).
- Distance band: neighbors lie within a fixed distance.
- K nearest neighbors: each feature’s closest k features.
- Inverse distance: closer features get more weight.
This choice is not a technicality. It can change your result. Always justify it, and test more than one.
Null Hypothesis and Significance
Most spatial statistics test a null hypothesis, usually complete spatial randomness: the idea that the pattern is what chance would produce. The test then yields a p-value (the probability of seeing a pattern this strong by chance) and often a z-score (how many standard deviations the result lies from what randomness predicts). A small p-value, commonly below 0.05, suggests the pattern is real. Remember that significance is not importance: a statistically significant pattern can still be tiny in practice.
Global vs. Local Statistics
- Global statistics give one number summarizing the whole study area, such as: is there clustering overall?
- Local statistics give a result for each feature, such as: where exactly are the clusters?
You usually need both. Global statistics tell you whether to look; local statistics tell you where.
Measuring Spatial Autocorrelation: Moran’s I
Moran’s I is the most widely used global measure of spatial autocorrelation. It compares how similar each feature is to its neighbors against the overall variation in the data.
- A value near +1 indicates strong clustering of similar values.
- A value near 0 suggests a random arrangement.
- A value near -1 indicates a dispersed pattern, with dissimilar values neighboring each other.
The tool returns the index, a z-score and a p-value. If the p-value is small, you can reject the idea that the pattern is random.
When to use it: to test whether a variable, such as unemployment rate by district, is spatially clustered at all, before searching for specific clusters.
A practical caution: Moran’s I tells you that clustering exists, not where. For the where, you need a local statistic. Our dedicated article, Spatial Autocorrelation and Moran’s I Explained, goes further into this.
Finding Hot Spots and Cold Spots: Getis-Ord Gi*
Getis-Ord Gi* (pronounced “G-i-star”) is the classic local statistic for finding hot spots (clusters of high values) and cold spots (clusters of low values).
For each feature, the tool looks at the feature and its neighbors and asks whether that local group has values much higher, or much lower, than the overall average, more than chance would explain. The output for each feature is a z-score and p-value:
- High positive z-score, small p-value: a statistically significant hot spot.
- High negative z-score, small p-value: a statistically significant cold spot.
- Scores near zero: no significant clustering.
Many GIS tools also report confidence levels (90, 95 or 99 percent) that make the map easy to read.
An important point I always stress: a hot spot is not simply a place with high values. It is a place with high values surrounded by other high values. A single very high feature amid low neighbors will not be flagged.
Typical uses: crime hot spots, disease clusters, traffic accident concentrations, customer density, wildfire incidence. See our full guide, Hotspot Analysis with Getis-Ord Gi* Explained.
Detecting Clusters and Outliers: Anselin Local Moran’s I
Where Gi* highlights hot and cold spots, Local Moran’s I (also called LISA, Local Indicators of Spatial Association) distinguishes four meaningful patterns:
- High-High (HH): a high value surrounded by high values: a cluster.
- Low-Low (LL): a low value surrounded by low values: a cluster.
- High-Low (HL): a high value surrounded by low values: a spatial outlier.
- Low-High (LH): a low value surrounded by high values: another spatial outlier.
The outliers are often the most interesting results. A single wealthy household in a poor district, or an isolated clinic with unusually poor outcomes, deserves a closer look.
Point Pattern Analysis
Sometimes your data isn’t values in polygons, but individual events such as accidents, trees, or burglaries. Here you ask whether the points are clustered, random or regularly spaced.
- Nearest neighbor analysis: compares the average distance between neighboring points to what a random pattern would produce.
- Ripley’s K function: examines clustering across many distance scales, revealing at what scale the pattern appears.
- Kernel density estimation (KDE): turns points into a smooth density surface, showing where events concentrate. It is descriptive and visually powerful, but it does not test significance by itself.
- DBSCAN and other clustering algorithms: group points into clusters of density, and identify noise. They are part of our companion article, Spatial Clustering: DBSCAN, K-Means, and Cluster Analysis.
Spatial Regression: Explaining the Pattern
Finding a pattern is one thing. Explaining it is another. Regression models relationships between a dependent variable (for example, house prices) and explanatory variables (size, distance to schools, noise). But ordinary regression assumes independent observations, which spatial data often violates.
The key tools are:
- OLS (Ordinary Least Squares): the baseline. Always check its residuals for spatial autocorrelation using Moran’s I. If they cluster, your model is missing something.
- Spatial lag and spatial error models: account explicitly for spatial dependence in the variable or in the errors.
- Geographically Weighted Regression (GWR): allows relationships to vary across space. Perhaps the effect of distance to the beach on price is strong near the coast and nonexistent inland. GWR will show it.
The lesson: if your residuals are spatially patterned, you are not done.
Geostatistics and Kriging
Geostatistics deals with continuous phenomena that you sample at points, such as soil contamination, rainfall or groundwater levels. Its central tool is the variogram, which describes how similarity between measurements declines with distance. From it, kriging produces an interpolated surface and, crucially, a map of prediction uncertainty. That uncertainty map is something simpler methods can’t offer, and it makes geostatistics invaluable in mining, environmental science and agriculture.
A Step-by-Step Workflow
Here is the sequence I follow in real projects.
- Formulate the question and the hypothesis in plain words.
- Prepare the data: clean geometry, a suitable projected CRS, appropriate aggregation level.
- Explore visually first: maps, histograms, and basic statistics.
- Choose the spatial relationship (neighborhood definition) and justify it.
- Run a global test such as Moran’s I, to see whether there is clustering at all.
- Run a local analysis such as Gi* or Local Moran’s I to find where.
- Test the sensitivity: repeat with a different neighborhood definition or scale.
- If explaining, model: run regression, check residuals, consider spatial models.
- Interpret with caution, and describe the limits.
- Communicate clearly with maps, legends and a plain-language note on the method.
Common Pitfalls
- Ignoring the Modifiable Areal Unit Problem. Results can change with the way areas are drawn or aggregated. Test different zonings.
- Choosing neighbors carelessly. Different definitions give different answers.
- Skewed or tiny counts. Rates based on very small populations are unstable. Use spatial smoothing or empirical Bayes rates.
- Edge effects. Features at the boundary have fewer neighbors.
- Multiple testing. When you test many features, some will appear significant by chance. Good tools apply a False Discovery Rate correction.
- Confusing statistical significance with importance.
- Wrong CRS. Distance-based methods require a projected CRS.
- Inferring causes. Clusters suggest hypotheses; they do not prove explanations.
Tools to Get Started
- ArcGIS Pro: the Spatial Statistics toolbox, with Hot Spot Analysis, Cluster and Outlier Analysis, Spatial Autocorrelation and GWR.
- QGIS: processing tools and plugins covering many of these methods, plus integration with R.
- GeoDa: a free, user-friendly program created specifically for exploratory spatial data analysis. Excellent for learning.
- Python: the PySAL family (esda, libpysal, spreg, mgwr) is outstanding for reproducible workflows.
- R: packages such as spdep, spatstat, gstat and sf are the research standard.
If you are a beginner, I suggest GeoDa to build intuition, then moving to Python or R as your skills grow.
Final Thoughts
Spatial statistics gives you something precious: the ability to say, with honesty, this pattern is probably real or this pattern is probably noise. That discipline protects you, your clients and your decisions. In my own career, the analyses I’m proudest of aren’t the flashiest maps but the ones that survived tough questions.
Learn the core ideas: autocorrelation, neighborhoods, significance, local versus global. Practice on a dataset you understand well, and always be ready to say, “the data does not support a pattern here.” That, too, is a result.
Where to go next: study each major technique in detail with Hotspot Analysis with Getis-Ord Gi* Explained, Spatial Autocorrelation and Moran’s I Explained and Spatial Clustering: DBSCAN, K-Means, and Cluster Analysis.



