What is Moran’s I? (Definition & Example)

Moran’s I is a statistical measure used to determine the spatial autocorrelation, or the degree of similarity, between neighboring data points in a dataset. It is calculated by comparing the value of a variable at each location with the values of the same variable at neighboring locations. This measure ranges from -1 to 1, where negative values indicate a dispersed pattern and positive values indicate a clustered pattern. A value of 0 indicates no spatial autocorrelation. An example of using Moran’s I would be analyzing the distribution of crime rates in a city, where a high positive value would suggest that areas with high crime rates are surrounded by other areas with high crime rates.

What is Moran’s I? (Definition & Example)


Moran’s I is a way to measure spacial autocorrelation. 

In simple terms, it’s a way to quantify how closely values are clustered together in a 2-D space. It’s often used in geography and to measure how closely clustered different features are on a map like household income, level of education, etc.

Moran’s I: The Formula

The formula to calculate Moran’s I is:

I = (N/W)*ΣΣwij(xix)(xjx)/Σ(xix)2

where:

  • N: The number of spacial units indexed by i and j
  • W: The sum of all wij
  • x: The variable of interest (household income, years of schooling, etc.)
  • x: The mean of x
  • wij: A matrix of spacial weights

You’ll likely never have to calculate this measure by hand since most statistical software can calculate it for you, but it’s useful to know the formula being used under the hood.

The value for Moran’s I can range from -1 to 1 where:

  • -1: The variable of interest is perfectly dispersed
  • 0: The variable of interest is randomly dispersed
  • 1: The variable of interest is perfectly clustered together

Along with computing Moran’s I, most statistical software will compute a corresponding p-value that can be used to determine whether or not the data is randomly dispersed or not.

Moran’s Test uses the following null and alternative hypotheses:

Null Hypothesis (H0): The data is randomly dispersed.

Alternative Hypothesis (HA): The data is not randomly dispersed, i.e. it is clustered in noticeable patterns.

If the p-value that corresponds to Moran’s I is less than a certain significance level (i.e. α = .05), then we can reject the null hypothesis and conclude that the data is spatially clustered together in such a way that it is unlikely to have occurred by chance alone.

Moran’s I: A Few Examples

The following examples represent fake maps with different values for Moran’s I.

Moran’s I = 0: Average Household income is randomly dispersed (i.e. random clusters in random areas).

Example of Moran's I

Moran’s I = -1: Average Household income is perfectly dispersed.

Moran's I in spatial statistics

Moran’s I = 1: Average Household income is perfectly clustered.

Moran's I

Refer to for a real-world example of computing Moran’s I in the statistical software R.

x