You are on page 1of 17

3/09/2021

Lecture 6

GIS220:
Spatial autocorrelation I

Prof Gregory Breetzke


greg.breetzke@up.ac.za
Room 1-19, Geography

Lecture outline

• What is spatial autocorrelation?

• Types of spatial autocorrelation


– Positive
– Negative
– Random

• Diagnostic measures
– Moran’s I

1
3/09/2021

What is it?

‘A complicated name for the obvious fact that data from locations near one
another in space are more likely to be similar than data from locations
remote from one another’ O’Sullivan & Unwin (2010)

“Everything is related to everything else, but near things


are more related to each other” Tobler (1970)

Spatial Autocorrelation vs. Scattergram

Scattergram Spatial Autocorrelation


• Association between two • Association between one
variables, e.g. % unemployed variable and the same
vs. % foreign born. variable in (spatially) nearby
areas, % foreign born.

© UP 2018: GIS 220 4

2
3/09/2021

Spatial autocorrelation

Examples: -2.60 - -1.01


-1.00 - -.392
-.391 - .224
.225 - .867
.868 - 1.34

✓ Housing market
1.35 - 1.91
1.92 - 3.26
City Boundary

✓ Elevation change Milwaukee River

✓ Temperature


Geology
Crime ±
✓ Health
4 2 0 4

Kilometers

Volumetric soil moisture (% m3/m3)

If spatial autocorrelation were


not commonplace, geography
would be irrelevant!

Spatial autocorrelation

Geographers examine the pattern of how variables are distributed just like points. Is
there clustering in this data? Where do areal units seem random? What might
explain any of these patterns?

3
3/09/2021

Spatial autocorrelation

• If there is any systematic pattern in the spatial


distribution of a variable, it is said to be spatially
autocorrelated

– If nearby or neighbouring areas are


more alike, this is positive spatial autocorrelation

– Negative autocorrelation describes patterns in


which neighbouring areas are unlike

– Random patterns exhibit no spatial autocorrelation

Positive vs. Negative


Positive (Common) Negative (Rare)
• Clusters of similar values: • Clusters of dissimilar values
– High values surrounded by high (think regular pattern):
values.
– High values surrounded by low
– Median values surrounded by median values.
values.
– Intermediate values surrounded by
– Low values surrounded by low intermediate values.
values.
– Low values surrounded by high
values.

Like values spatially cluster! Unlike values spatially cluster!


DISPERSED
UNIFORM/
CLUSTERED

© UP 2018: GIS 220 8

4
3/09/2021

Positive vs. Random


Positive Random

Negative vs. Random


Negative Random

5
3/09/2021

Spatial autocorrelation

Positive ?

Negative ?

None ?

How do we know ??

• Spatial autocorrelation diagnostic measures

- Joins count statistics

- Moran’s I

- Geary’s C

- Variogram cloud

• Measures test whether the distributions


of point events or areal units are related to
each other

6
3/09/2021

Moran’s I

• Classic measure of global spatial dependence

• Similar to correlation coefficient: varies between –1.0 and + 1.0


– 0 indicates no spatial autocorrelation
– When autocorrelation is high, the I coefficient is close to 1 or -1
– Negative/positive values indicate negative/positive autocorrelation

• Differences from correlation coefficient are:


– Involves one variable only, not two variables
– Incorporates weights (wij) which index relative location
– Think of it as “the correlation between neighbouring
values on a variable”
– More precisely, the correlation between variable, X, and
the “spatial lag” of X formed by averaging all the values of
X for the neighbouring polygons

Moran’s I

n n
N   w ij (x i − x)(x j − x)
i =1 j=1
I = n n n
(  w ij ) (x i − x) 2
i =1 j=1 i =1

1 If zone i an zone j are adjacent


wij =
0 otherwise

Where N is the number of cases


X is the mean of the variable
Xi is the variable value at a particular location
Xj is the variable value at another location
Wij is a weight indexing location of i relative to j

7
3/09/2021

But first!

Spatial weights matrix is an essential part of the


computation of Moran’s I

But what is it??

Moran’s I

• Spatial weights matrix


• A representation of the spatial structure of your data
• Binary or variable weighting

• Weights based on Contiguity


• If zone j is adjacent to zone i, the interaction receives a weight of 1,
otherwise it receives a weight of 0 and is essentially excluded
• But what constitutes contiguity? Not as easy as it seems!

• Weights based on Distance


• Uses a measure of the actual distance between points or between
polygon centroids
• But what measure, and distance to what points?

8
3/09/2021

Who is my neighbour?

Rook’s case Queen’s case


(share an edge) (share a vertex)

Who Is My Neighbour?
Hexagons Irregular

9
3/09/2021

Moran’s scatter plots: example

Sacramento

Moran’s scatter plots: example

• PolyID 2 = Household income = $ 51,958

10
3/09/2021

Moran’s scatter plots: example

PolyID 1 = $ 52,941
PolyID 3 = $ 32,992 PolyID 2 = $ 51,958
PolyID 4 = $54,556
PolyID 6 = $60,167
Average = $ 50,164

Rook’s case

Moran’s scatter plots: example

Moran’s I can be interpreted as the correlation


between variable, X, and the “spatial lag” of X
formed by averaging all the values of X for the
neighbouring polygons

11
3/09/2021

Moran’s scatter plots: example

2nd Order Contiguity


Rooks Queens

© UP 2018: GIS 220 24

12
3/09/2021

Spatial Weights: Variable


Distance Weights k-Nearest Neighbour Weights
• Uses a measure of the • Evaluated on the number of
actual distance between nearest neighbours (k).
points or between polygon • Distance not important.
centroids. • E.g., k = 6
– Based on a function of
– Then every value/location
distance, e.g. inverse distance
must have at least 6
(reciprocal).
neighbours.
– Others: inverse distance
squared (IDW), negative
exponential.

© UP 2018: GIS 220 25

Moran’s scatter plot: example

n n
N   w ij (x i − x)(x j − x)
i =1 j=1
I = n n n
(  w ij ) (x i − x) 2
i =1 j=1 i =1

Neighbourhood X
It’s value: $95,000
It’s neighbours value: $45,000

13
3/09/2021

In GeoDa: Scottish lip cancer

Step 1: Display the data

In GeoDa: Scottish lip cancer

Step 2: Create spatial


weights file

14
3/09/2021

In GeoDa: Scottish lip cancer

Step 3: Construct Moran’s I

In GeoDa: Scottish lip cancer

BUT
IS IT
SIGNIFICANT?

Step 4: Display the Moran scatterplot

15
3/09/2021

But is the result significant??

In ArcGIS: Scottish lip cancer

Step 1: Display the data

16
3/09/2021

In ArcGIS: Scottish lip cancer

Step 2: Create spatial weights file

In ArcGIS: Scottish lip cancer

Step 3: Display the Moran’s I

17

You might also like