**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 geographic information science (GIS) 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)*ΣΣw_{ij}(x_{i}–x)(x_{j}–x)/Σ(x_{i}–x)^{2}

where:

**N:**The number of spacial units indexed by*i*and*j***W:**The sum of all w_{ij}**x:**The variable of interest (household income, years of schooling, etc.)**x:**The mean of x**w**A matrix of spacial weights_{ij}:

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 (H _{0}):** The data is randomly dispersed.

**Alternative Hypothesis (H _{A}):** 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.

Assume that each square in the map represents a county and that counties with average household incomes greater than $50k are shown in blue.

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

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

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

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