Spatial Autocorrelation and Hotspot Analysis

Spatial autocorrelation and hotspot analysis: near things resemble each other

Spatial autocorrelation and hotspot analysis show how to tell with numbers whether accidents or disasters are concentrated in particular areas or are just chance.

In short

  • Tobler's law: near places resemble each other more than distant places do.
  • Moran's I checks whether a spatial pattern is random or clustered.
  • Getis-Ord hotspots find areas where accidents and disasters are concentrated.

Spread out a traffic accident map of an area and you notice stretches where accidents are especially concentrated. Looking at it, one person says, "This is a dangerous place," while another can counter, "The dots only happen to look clustered." Both sound plausible, and that is the problem. The human eye has a habit of finding patterns even in randomly scattered dots. This is where spatial statistics comes in. Spatial autocorrelation and hotspot analysis are the tools that test statistically whether an area really has accidents or disasters concentrated differently from its surroundings, or whether it only looks that way because the dots happen to be sparse and scattered.

color-coded density map
Stock photo. Photo: lucasgeorgewendt / Pixabay

What is Tobler's first law?

The geographer Waldo Tobler said, "Everything is related to everything else, but near things are more related than distant things." This is called Tobler's first law. Put simply, your neighbor's house and yours are likely to have similar weather and similar prices, but a house in another country is not. The law looks too obvious, but it is the premise of all statistics for spatial data. Ordinary statistics assume that data points are independent of each other, but spatial data resemble their neighbors, so that assumption breaks down. Disaster data is the same. The slope next to a landslide site often has similar geology and incline, so its landslide risk often looks similar. If you ignore this neighbor effect and treat each point only as an independent event, it becomes hard to explain why the damage was concentrated in a particular valley.

What does Moran's I tell you?

Moran's I is an index that summarizes spatial autocorrelation in a single number. The value usually falls between -1 and 1. Close to 1 means similar values are clustered together (clustering), close to -1 means similar values are far apart and alternate like a chessboard (dispersion), and close to 0 means the pattern is close to random. What matters is that you look not only at the value itself but also at "how likely is this pattern to occur by chance." You usually check a number called the p-value (the probability of getting such a result by chance) together with it, and this must be small enough before you can say "there is a real pattern." For example, if you compute Moran's I for areas with flood damage reports and the value is high and the p-value is small, you can back up statistically that the damage is concentrated in particular low-lying areas. Conversely, if the value is low, the damage is scattered evenly across the region, so you should first suspect overall rainfall rather than local causes such as drainage facilities.

How is a hotspot (Getis-Ord) different?

If Moran's I tells you in one number "is there a pattern overall," Getis-Ord Gi* (Gi-star) points out, location by location, "so where exactly are the hot places (hotspots) and the cold places (cold spots)?" It compares the value at each location with its neighbors, and marks as hotspots the places where significantly high values are clustered relative to the whole surroundings, and as cold spots the places where significantly low values are clustered. The result is usually shown on the map in colors divided into 90%, 95% and 99% confidence bands. If you run this analysis on wildfire ignition history data, you can pick out areas where ignitions are statistically significantly concentrated, not just places with many dots. Hotspots extracted this way are often used as grounds for deciding preventive patrol routes or the priority for placing surveillance cameras.

How do you apply it to accident data?

Data accumulated as points, such as traffic accidents and emergency calls, pairs well with hotspot analysis. One caution, though: rather than using the point data as is, it is common to aggregate it into a grid (squares of a fixed size) or administrative units before analysis. This reduces the position error of individual points and chance clumping. Another important point is that the result changes depending on how you define neighbors. The shape and extent of a hotspot change depending on whether you count everything within 500 meters as neighbors, or only adjacent administrative districts. So this setting has no fixed right answer; it is closer to something you learn by trying. You need to run it repeatedly with several distance values and find a stable range where the result does not change much. Accident hotspots found this way are used to set the priority of real measures, such as improving traffic safety facilities or checking access routes to shelters.

Cautions for hotspot analysis

Hotspot analysis shows "where it is dangerous," but not "why it is dangerous." Cause analysis is a separate task. Also, in areas with little data, even a few cases happening to cluster can look like a hotspot, so be sure to check that the sample size is sufficient. It is also good to know the phenomenon where the result changes when administrative boundaries change (called the modifiable areal unit problem). It means that the shape of a hotspot can change depending on whether the analysis unit is a township or a 1 km grid. At a disaster response site, it is safer to use this result not as the sole basis but as a supporting tool, cross-checked with field surveys and other statistics.

Step by step on screen

The figure below is a diagram that summarizes the order of the steps. Menu positions are the same in the English interface.

Steps to follow

  1. Prepare the data
    Prepare a table (csv) or a point layer containing the latitude and longitude of accident or disaster points
  2. Check your QGIS installation
    After starting QGIS, look in the Plugins menu to see whether tools for spatial statistics are installed (the position may differ by version)
  3. Load the layer
    Load the csv or shp file with Layer > Add Layer > Add Vector Layer
  4. Set the spatial weights
    In the Processing Toolbox, search for and run a distance-based weights or contiguity-based weights tool
  5. Run Moran's I
    In the Processing Toolbox, search for "Moran's I" or "spatial autocorrelation", specify the target field and run it
  6. Check the result
    Check the output Moran's I value and p-value in the log panel and show them on the map as colors

Menu names may differ slightly between program versions.

Prompts you can copy

Rewrite spatial autocorrelation results as report sentences

Your role is a GIS analyst who explains spatial statistics in plain terms.
Based on the analysis results below, write a summary of two or three paragraphs that a non-specialist can understand.
The analysis target is [analysis target, e.g. 2024 traffic accident locations],
Moran's I is [value], and the p-value is [value].
The areas classified as hotspots are [list of area names].
Add an easy explanation in parentheses for statistical terms,
do not speculate about causes that have not been confirmed; just say "further investigation is needed",
and write the result in the form of a paragraph for the introduction of a report.

Replace the bracketed parts for your situation. Check the facts in any answer before you use it.

Try it yourself

  • Load accident data for your own area into QGIS or a public GIS tool and plot it as points on a map.
  • With the same data, change the grid size (500 m, 1 km) and compare how the hotspot result changes.
  • Using disaster report statistics from the news or a public data portal, calculate Moran's I yourself and check the p-value.

Common questions

Q. If Moran's I is high, is the area always dangerous?
A. No. A high value only means similar values are clustered together, and those values themselves may be clustered at a low level. You must always interpret it together with the size of the original data.

Q. What is the difference between hotspot analysis and just looking for places with many dots on a map?
A. Even if there seem to be many dots, with a large amount of data overall that can happen by chance. Hotspot analysis differs in that it tests whether the concentration is statistically significant compared with the surroundings.

Q. Is there a minimum amount of data needed for this analysis?
A. There is no fixed standard, but if the sample is too small the result becomes unstable. It is safer to check yourself whether the result stays consistent when you change the period or the unit.

What comes next

The simple idea that near things resemble each other is the starting point of spatial statistics, and the moment you test that idea with numbers, a feeling about a map turns into a judgment with evidence. A later post in this series covers spatiotemporal analysis, which adds the time axis to the hotspots found this way and looks at "when and where" risk repeats.

This is an English adaptation of a post in the Korean GeoAI basics series. The original is here, and more learning materials are on GeoAI for Disaster Safety.

This post was drafted with the help of AI tools and reviewed by the author. Tool features and data portals change over time, so check the official documentation when you practice.

Comments

Popular posts from this blog

What Is GeoAI, and How Does It Help Disaster Safety?

Getting Started with QGIS: What to Do First

Whitebox QGIS Practice 26 — Elevation Statistics of Two Basins: Means of 2,000.1 m and 1,924.3 m, a 76 m Gap