MORAN'S I · SPATIAL AUTOCORRELATION · GEARY'S C · LISA · CLUSTER AND OUTLIER ANALYSIS · GETIS-ORD GI* HOT SPOTS · RUNS IN YOUR BROWSER

Are high values next to high values?

Prices, incomes, disease rates, soil readings, crime counts: on a map they rarely fall at random. Paste one row per place with its coordinates (or a neighbour list of which areas share a border) and the value, and get Moran's I with analytic and permutation p-values, Geary's C and Getis-Ord General G; the local Moran (LISA) map of clusters and outliers; Gi* hot and cold spots; the Moran scatterplot; and a correlogram of how the pattern fades with distance. No GIS, no install, numbers checked against PySAL.

Nothing you enter leaves this browser tab. A description of the pattern in the numbers you give, not proof of what caused it, and not public-health, planning or other professional advice.

Your places

The example: did America's rich and poor states stay neighbours?

Per-capita personal income of the 48 contiguous states, every year from 1929 to 2009, from the Bureau of Economic Analysis, with shared borders as the neighbours (a state's neighbours are the states it touches, corners included). Rey and Montouri (1999) used this BEA series to show that regional income convergence in the US has a spatial shape. Load it and the page runs all 81 years.

State centroids are computed from the outlines in the same bundle (data/SOURCE.md); incomes are in current dollars, which does not matter to Moran's I within a year. Contiguity is from the state outlines and equals PySAL's bundled file exactly (214 links).

Method and citation

Write z for the values minus their mean and W for the weights (row-standardised by default). Moran's I (1950) is n/S0 · ΣiΣj wij zi zj / Σzi², with expected value −1/(n−1) when there is no pattern. Geary's C (1954) is (n−1) ΣiΣj wij(yi−yj)² / (2S0 Σzi²), expected 1. Both get the variances under normality and under randomisation from Cliff and Ord (1981), built from the weight sums S0, S1, S2 and the kurtosis of the values. General G (Getis and Ord 1992) is Σi≠j wij yi yj / Σi≠j yi yj on binary weights. Local Moran's I (Anselin 1995) is (n−1) zi Σj wij zj / Σzj² on standardised values; its p-value comes from conditional permutation (place i keeps its value, the others are shuffled into its neighbourhood), and an analytic z under conditional randomisation (Sokal, Oden and Thomson 1998) is in the JSON. Gi* (Ord and Getis 1995) standardises the sum of a place and its binary neighbours. The optional cut-off for the local tests is Benjamini and Hochberg's (1995).

Permutation p-values are two-sided here. PySAL and GeoDa report the share of shuffles at least as extreme in the observed direction, which rejects a true null about twice as often as the level suggests; this page doubles it (FAQ below). With the false-discovery-rate option on, local Moran uses at least 2n/α permutations so the smallest p can pass.

Limits. One variable at a time (no bivariate Moran), no rate smoothing for small populations (a rate from 12 people is noisy and will look like an outlier; use the empirical-Bayes rate first), no spatial regression, and at most 5,000 places since every pair is compared. Distances on longitude and latitude are great-circle (haversine) kilometres.

Checked against: PySAL (esda 2.9.0, libpysal 4.14.1) on nine cases whose weights libpysal built itself: queen contiguity, great-circle k nearest neighbours, distance bands, inverse distance (powers 1 and 2), libpysal's own KNN, row-standardised, binary and raw. I, C, G, every variance, z and analytic p, every local I, quadrant and Gi* z agree to 1e-9. Gi* differs in sign from esda when the values sum to a negative number; esda divides by that sum, Ord and Getis's standardised form does not. A seeded null simulation (eval/calibration-output.txt) measured each test's false-positive rate.

@article{moran1950notes,
  author = {Moran, P. A. P.},
  title = {Notes on continuous stochastic phenomena},
  journal = {Biometrika}, volume = {37}, number = {1/2}, pages = {17--23}, year = {1950},
  doi = {10.2307/2332142}}
@article{geary1954contiguity,
  author = {Geary, R. C.},
  title = {The contiguity ratio and statistical mapping},
  journal = {The Incorporated Statistician}, volume = {5}, number = {3}, pages = {115--145}, year = {1954},
  doi = {10.2307/2986645}}
@book{cliff1981spatial,
  author = {Cliff, A. D. and Ord, J. K.},
  title = {Spatial Processes: Models and Applications},
  publisher = {Pion}, address = {London}, year = {1981}}
@article{getis1992analysis,
  author = {Getis, Arthur and Ord, J. K.},
  title = {The analysis of spatial association by use of distance statistics},
  journal = {Geographical Analysis}, volume = {24}, number = {3}, pages = {189--206}, year = {1992},
  doi = {10.1111/j.1538-4632.1992.tb00261.x}}
@article{ord1995local,
  author = {Ord, J. K. and Getis, Arthur},
  title = {Local spatial autocorrelation statistics: distributional issues and an application},
  journal = {Geographical Analysis}, volume = {27}, number = {4}, pages = {286--306}, year = {1995},
  doi = {10.1111/j.1538-4632.1995.tb00912.x}}
@article{anselin1995local,
  author = {Anselin, Luc},
  title = {Local indicators of spatial association---{LISA}},
  journal = {Geographical Analysis}, volume = {27}, number = {2}, pages = {93--115}, year = {1995},
  doi = {10.1111/j.1538-4632.1995.tb00338.x}}
@article{sokal1998local,
  author = {Sokal, Robert R. and Oden, Neal L. and Thomson, Barbara A.},
  title = {Local spatial autocorrelation in a biological model},
  journal = {Geographical Analysis}, volume = {30}, number = {4}, pages = {331--354}, year = {1998},
  doi = {10.1111/j.1538-4632.1998.tb00406.x}}
@article{benjamini1995controlling,
  author = {Benjamini, Yoav and Hochberg, Yosef},
  title = {Controlling the false discovery rate: a practical and powerful approach to multiple testing},
  journal = {Journal of the Royal Statistical Society: Series B}, volume = {57}, number = {1}, pages = {289--300}, year = {1995},
  doi = {10.1111/j.2517-6161.1995.tb02031.x}}
@article{rey1999us,
  author = {Rey, Sergio J. and Montouri, Brett D.},
  title = {{US} regional income convergence: a spatial econometric perspective},
  journal = {Regional Studies}, volume = {33}, number = {2}, pages = {143--156}, year = {1999},
  doi = {10.1080/00343409950122945}}

Questions

What is spatial autocorrelation?

It is the degree to which values at nearby places resemble each other. Positive autocorrelation means high values sit near high values and low near low (clusters); negative means neighbours tend to differ (a checkerboard); none means the map looks like the values were shuffled at random. Moran's I measures it on a scale where 0 is roughly no pattern, and Geary's C on one where 1 is no pattern.

How do I interpret Moran's I?

Compare it with its expected value under no pattern, minus 1 over (n minus 1), not with zero. Above that and significant means clustering; below and significant means dispersion. The value is not a correlation coefficient: its range depends on the weights, so compare I between variables or years on the same map and weights, not across different maps.

Which spatial weights should I choose?

For areas such as states, counties or tracts, a neighbour list of shared borders (contiguity) is the usual choice; most GIS software can export one. For points, k nearest neighbours guarantees every place has neighbours even where points are sparse; a distance band suits a process with a known reach; inverse distance lets closer places count more. Row-standardising (the default) makes the spatial lag an average of the neighbours. Try two or three reasonable choices: a conclusion that flips with the weights is weak.

Why are some local clusters probably false alarms?

Local Moran runs one test per place. In this page's own simulation of values with no spatial pattern at all, a map of 48 states showed at least one significant local cluster at p of 0.05 in 89% to 90% of runs, and a map of 120 points in 99% of runs. Turning on the false-discovery-rate option brought that down to between 4.5% and 9% of runs. Report the cut-off you used, and treat unadjusted local clusters as places to look, not findings.

Why is the permutation p-value here twice what GeoDa or PySAL shows?

PySAL's esda and GeoDa report a folded pseudo p-value: the share of shuffles at least as extreme in the direction the statistic happened to fall. That is a one-sided p, and testing it at 0.05 rejected a true null 9% to 12% of the time in this page's simulation. The page reports twice it, a two-sided p that rejected 4% to 6% of the time, and shows the one-sided number beside it in the JSON and the download.

What is the difference between local Moran clusters and Gi* hot spots?

Local Moran compares each place with its neighbours and finds both clusters (high-high, low-low) and outliers (a high place among low neighbours, or the reverse). Getis-Ord Gi* sums a place together with its neighbours and asks whether that neighbourhood total is unusually high or low, so it finds hot and cold spots but never outliers. ArcGIS's Hot Spot Analysis is Gi*.

Is my data uploaded anywhere?

No. Every number is computed by JavaScript in this browser tab. There are no accounts, cookies or analytics vendors.