Statistics Glossary → Moran's I (Spatial Autocorrelation)
Moran's I (Spatial Autocorrelation)analysis
A method that tests whether a variable takes similar values at nearby locations, that is, whether there is spatial autocorrelation, both with a single statistic for the whole area (global Moran's I) and separately for each location (local Moran, LISA).
Concept
According to the observation known as the first law of geography, nearby places are more alike than distant ones. How strong is this resemblance for a given variable? Are high values gathered together and low values somewhere else, or are the values scattered at random across the area? Moran's I answers this question. Spatial autocorrelation also matters because it breaks the 'observations are independent' assumption of classical statistical methods.
The neighbours of each unit are defined by a weights matrix (here, k nearest neighbours). Moran's I sums and scales the products of each unit's deviation from the mean and its neighbours' deviations from the mean; it is interpreted much like a correlation coefficient. The expected value of I under randomness is close to zero (−1/(n−1)); values clearly above it show that similar values cluster (positive autocorrelation), and values below it that neighbours tend to be dissimilar (negative autocorrelation). Significance is tested with a normal approximation or with permutations in which the values are shuffled randomly among locations. Local Moran (LISA) does the same calculation for each unit separately and classifies units as high-high, low-low, high-low and low-high.
The result depends on the definition of neighbours (the number k); trying several definitions is good practice. In LISA each unit is a separate test, so chance 'clusters' can appear through multiple comparisons; a correction (FDR, Bonferroni) limits this. If the value is a count (e.g. number of cases) and the units' populations differ greatly, high values may simply mark populous units; in that case rates or empirical Bayes rates should be used.
When to use it
- To test whether a variable measured for regions, districts or sampling points is spatially clustered, and to locate the clusters.
- If the aim is only to find clusters of high or low values (hot and cold spots), use Getis-Ord Gi*; for a global measure more sensitive to local differences, use Geary's C.
- If the question is whether the points themselves (the locations) are clustered rather than a measured value, use point pattern analysis; if spatial dependence is to be modelled for a prediction surface, variogram and kriging are preferred.
An everyday example
A district agriculture office maps the average wheat yield (kg per decare) of 90 villages. Villages on the northern plain seem to have high yields and the hilly villages in the south low ones; but is this impression real, or is the eye reading meaning into a random pattern? If global Moran's I = 0.45 with a permutation p = 0.001, neighbouring villages have clearly similar yields. The LISA map then marks the plain villages as a high-high cluster, and also flags as a high-low outlier a village with high yield surrounded by low-yield villages; the office can look into what is being done differently there.
Parameters in MerQur
Classify by / Method
Concept: Classify is a data-exploration step that colours the points by a categorical column before the analysis; Method chooses the spatial analysis to run on the map tab. Moran's I tests the spatial similarity of a measured value.
Everyday example: Colouring the villages as 'irrigated' or 'rain-fed' shows at a glance whether high-yield villages coincide with irrigated ones. Because the real question is 'are yields similar in neighbouring villages?', Moran's I is chosen.
What it does: Classify by colours the points by category; Method selects the map method.
Effect on the result: Does not change the numeric output.
K neighbors (default 8)
Concept: Sets how many nearest units each unit counts as neighbours, thereby defining 'nearness'. A small k looks at very local similarity, a large k at broader-scale patterns; if the result is sensitive to k, several values should be reported together.
Everyday example: With k = 4 each village is compared only with its four nearest villages, and small differences within a valley stand out. With k = 20 the comparison extends over a wide part of the district, and the large-scale plain-versus-hill pattern dominates.
What it does: Determines the number of neighbours of each unit; defines the scale of I and the LISA neighbourhood. In irregular points 4-8 is common; if the result is sensitive to k, several k should be reported.
Effect on the result: Changes I, z and the LISA clusters. If the neighbourhood graph is disconnected, k is automatically increased by 2 at a time (at most 20) and this is reported in the interpretation.
On the validation data: In Boston CMEDV, I 0.6302 for k = 4; 0.5610 for k = 8 (z 27.15); 0.4359 for k = 20 (z 33.99). At k = 3 the graph has 2 components: MerQur raises k to 5 (I 0.6177).
α (alpha) (default 0.05)
Concept: Sets the threshold at which both the global test and the local clusters are deemed significant. The smaller α, the fewer units are flagged as significant clusters and the lower the chance of false alarms.
Everyday example: With α = 0.10 many villages on the map fall into high-high or low-low clusters. With α = 0.01 only the clearest plain cluster remains; if the office wants to reduce the risk of directing resources to the wrong villages, it can choose the stricter threshold.
What it does: Determines the significance threshold in LISA and the global interpretation.
Effect on the result: Changes only the classification, not the statistics.
On the validation data: In Boston with 999 permutations, 350 not-significant (NS) points for alpha 0.01, 288 for 0.05, 248 for 0.10.
Permutation (0 analytic, 99, 999, 9999)
Concept: The permutation test shuffles the observed values randomly among locations to build the distribution of 'what I would be if there were no spatial pattern' and compares the observed I with it. It needs no distributional assumption; but since the smallest attainable p value is 1/(M + 1), M (the number of permutations) sets the resolution of the p value.
Everyday example: The yields of the 90 villages are reassigned at random to other villages 999 times, and I is computed each time. If none of these 999 shuffled maps gives an I as large as the real map, p = 1/1000 = 0.001; with 99 permutations the same result could only be reported as p = 0.01.
What it does: When 0, the global p is analytic (normal approximation); when greater than 0, the folded pseudo p by conditional permutation ((more extreme + 1)/(M + 1)). LISA is computed by permutation in every case (999 permutations, seed 12345 when M = 0; reported on screen).
Effect on the result: Changes the global p and the LISA counts; I and z do not change.
On the validation data: In Boston, global p 0.01 for 99, 0.001 for 999, 0.0001 for 9999 (the smallest possible values); analytic p 2.8e-162. LISA counts depend on the seed.
Multiple-comparison correction (None, FDR (Benjamini-Hochberg), Bonferroni)
Concept: Because each unit is tested separately in the local test, a few units can turn out significant purely by chance even when there is no real cluster. FDR controls the expected share of false positives among the significant results; Bonferroni controls the probability of any false positive and is stricter.
Everyday example: If 90 villages are each tested at the 5% level, on average 4 or 5 could come out significant even with no real pattern. The FDR correction weeds out most of these chance villages; Bonferroni leaves only very strong clusters.
What it does: Since each point is tested separately, classifies with corrected p < α to limit false positive clusters.
Effect on the result: Changes the significance classes of the clusters.
On the validation data: In Boston, uncorrected not-significant points 288; FDR 331; Bonferroni 456.
Global inference (Normality assumption, Randomization assumption)
Concept: When permutations are not used, the variance of I can be computed under two assumptions: the normality assumption treats the values as drawn from a normal distribution, while the randomisation assumption takes the observed values as randomly allocated to locations. If the values are skewed or heavy-tailed, randomisation is safer.
Everyday example: If village yields are roughly bell-shaped, the two assumptions give almost the same z value. If a few villages have yields far above the rest, the randomisation assumption is more appropriate.
What it does: When permutation is off, selects the normality or randomization assumption for Var[I] (moran.test randomisation = FALSE / TRUE).
Effect on the result: Changes Var and z; does not change I. When permutation > 0 the p on screen is the permutation p.
On the validation data: In Boston Var 0.00043008 / 0.00042879, z 27.146 / 27.187.
LISA p definition (z_sim normal approximation, Folded permutation p)
Concept: Sets how the p value of the local permutation test is computed: z_sim forms a z value from the mean and standard deviation of the permutation distribution and gives p by a normal approximation; the folded p is the share of permutations giving a result more extreme than the observed one and needs no distributional assumption.
Everyday example: If a village's local I is exceeded in only 4 of the 999 shuffled maps, the folded p = (4 + 1)/1000 = 0.005. For the same village z_sim gives a value close to this, but not exactly the same, based on the normal distribution.
What it does: z_sim: one-sided normal p with z from the permutation distribution; folded p_sim: (more extreme permutation + 1)/(M + 1), smallest 1/(M + 1).
Effect on the result: Changes the local p values and hence the number of significant clusters.
On the validation data: In Boston the number of not-significant points is 288 / 290.
Seed (0 = automatic)
Concept: The seed is the starting point of the random number sequence that generates the permutations. Repeating the analysis with the same seed gives the same p values and the same LISA map.
Everyday example: If another expert wants to reproduce the LISA map in the office's report, using the same seed yields exactly the same significant villages. With a different seed, the class of one or two borderline villages may change.
What it does: Determines the random number seed of the permutations; the same seed gives the same result.
Effect on the result: Affects only permutation-based outputs.
On the validation data: With the same seed two runs are the same (the interface and the engine also the same); at 0 every run is different.
Additional statistic (None, Geary's C, Bivariate Moran, EB rate Moran) and Second column
Concept: Geary's C is an autocorrelation measure based on squared differences between neighbours and is more sensitive to local differences (C < 1 means positive autocorrelation). Bivariate Moran measures how one variable relates to a second variable in neighbouring units. The empirical Bayes rate Moran shrinks the volatile rates of units with small populations towards the overall mean, giving a more reliable test for count data.
Everyday example: Bivariate Moran answers 'are yields also high in the neighbours of villages with high rainfall?'. If cases of pesticide poisoning in the villages are being studied, a single case in a village of 100 people produces a very high rate; the empirical Bayes rate stops such small villages from misleading the map.
What it does: Geary's C measures autocorrelation sensitive to local differences (C < 1 positive). Bivariate Moran measures the relationship of the value with the neighbour mean of the second variable. EB rate Moran uses the Assunção-Reis (1999) empirical Bayes rate when value = number of events and second column = population.
Effect on the result: Adds a further statistic and its test to the report; the global I does not change.
On the validation data: Boston Geary's C 0.3848, z -26.83; C 0.8554 for NC. Bivariate Moran (CMEDV with CRIM) I_xy -0.2956; EB rate (SID74/BIR74) I 0.2226.
Local I_i (LISA) definition
Concept: The local Moran value is the product of a unit's deviation from the mean and its neighbours' average deviation; if positive the unit resembles its neighbours, if negative it does not. The cluster class (high-high, low-low, high-low, low-high) is set by the signs of these two deviations.
Everyday example: A plain village whose yield is above average, with neighbours also above average, falls into the high-high class. A village with a high yield but low-yield neighbours is high-low and has a negative local I; it is an outlier within its area.
What it does: MerQur uses the Anselin (1995) local Moran definition I_i = (n - 1) z_i (Wz)_i / sum z^2; the cluster quadrant is set by the signs of (z, Wz).
Effect on the result: Sets the scale of the local I_i values; the ratio between the two definitions is (n - 1)/n.
On the validation data: To move to the other definition, the MerQur I_i values are multiplied by n/(n - 1). Quadrants are assigned by the sign of the deviation from the mean and of its spatial lag.
Example on real data
Data: Cressie and Chan 1989, spData nc.sids
Variables: 100 county centroids (latitude/longitude), value SID74 (sudden infant deaths 1974-78); seed 20261012
- Question: Do the 1974-78 sudden infant death counts (SID74) in North Carolina counties cluster in space?
- Method: k = 8 nearest neighbours (great circle), row-standardised weights; global Moran's I and local LISA, 999 permutations.
- Result: I = 0.132 (E[I] = -0.010), z = 3.10, permutation p = .007; similar values gather in neighbouring counties, there is positive spatial autocorrelation.
- Effect size: The I value is small (0.13); the clustering is significant but weak.
- Local finding: 8 high-high (hot) and 17 low-low (cold) county clusters, 3 low-high and 1 high-low outlier counties; 71 counties not significant.
- Limitation: LISA runs 100 separate tests, so without correction some clusters may be due to chance; also, the counts are not rated by the number of births.
- Report line: Moran's I = 0.132, z = 3.10, p = .007 (999 permutations, k = 8).
Related concepts
Permutation p-valueRandom seedSignificance level (α)Asymptotic (normal) approximationLocal indicators of spatial association (LISA) and Gi*Spatial autocorrelation (Moran's I, Geary's C)Spatial weights matrix (W)Multiple comparisons and the familywise error rate (FWER)
The numbers in the examples are MerQur's output on independent, publicly available validation data; see the MerQur Technical Note for details.