Class_3_ESDA_R
Class_3_ESDA_R
Análisis espacial’
Universidad Icesi - Cali
April 23, 2018
2 Spatial Autocorrelation
Issues to consider
Hypothesis
Tests for the presence of Spatial autocorrelation
Spatial weights matrices
Global Spatial Autocorrelation
Moran’s I
Geary’s C
Moran’s Scatterplot
Local Spatial Autocorrelation
3 ESDA using R
Graphical and visual methods or tools that are used to identify data
properties for purposes of
Detect patterns in the data
Formulate hypothesis from the data
Assess various aspects of models (e.g., goodness-of-fit)
EDA also uses statistics to identify outliers and detect patterns and other
characteristics in the data.
Spatial Autocorrelation
“All places are related but nearby places are more related than distant
place”
Spatial autocorrelation is the formal property that measures the degree to
which near and distant things are related
Issues to consider
Issues to consider
Issues to consider
Issues to consider
Spatial Autocorrelation
Spatial Autocorrelation
Spatial Autocorrelation
Spatial Autocorrelation
Spatial Autocorrelation
Spatial Autocorrelation
Spatial Autocorrelation
Spatial Autocorrelation
Spatial Autocorrelation
Spatial Autocorrelation
Moran’s Index
Moran’s Index
Pn Pn
n i=1 j=1 wij (yi − ȳ )(yj − ȳ )
I = Pn (3)
( i=1 (yi − ȳ )2 )(
PP
i6=j wij )
n = number of regions.
Wij = Measure of Spatial proximity between region i and j
Moran’s Index
Moran’s Index
Inference
Normal: assume uncorrelated normal distribution
Z-Value: compute E (I ) and Var (I )
z = (I − E (I ))/SD(I ) Regular Standarization.
Moran’s Index
Moran’s Index
Moran’s Index
Geary’s Coefficient
Geary’s Coefficient
Geary’s Coefficient
Moran’s Scatterplot
Moran’s Scatterplot
Moran’s Scatterplot
Anselin (1995)
Local Spatial Statistic
indicate significant spatial autocorrelation for each location
Local-Global Relation
sum of LISA proportional to a corresponding global indicator of
spatial autocorrelation
n(yi − ȳ ) X
Ii = P 2
wij (yi − ȳ ) (4)
j (yi − ȳ ) j
● ● ●
●
●
● ● ● ●●
● ●
● ●
● ● ●●
●
● ●
● ● ●
● ● ● ●●
●
● ● ●
● ● ●
● ● ●
● ● ●
●
● ● ●
● ●
●
● ● ●
●
●
● ● ● ●●
● ●
● ●
● ● ●●
●
● ●
● ● ●
● ● ● ●●
●
● ● ●
● ● ●
● ● ●
● ● ●
●
● ● ●
● ●
●
● ● ● ● ● ●
●
●● ●
● ● ● ●● ●
● ● ● ● ● ● ●
●● ● ● ●● ●
● ● ●
● ● ● ● ● ● ● ● ●
● ● ● ●
● ● ● ● ● ●
● ● ● ● ● ● ● ●
● ● ●
● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ●
● ● ●
● ● ● ● ● ● ● ●
● ● ●
● ● ●
● ●
●
● ● ● ● ● ●● ● ● ● ● ● ● ● ●●
● ● ● ● ●
● ● ● ●
● ● ● ● ● ●
● ● ●
● ● ● ● ● ● ● ●
● ● ● ● ● ●
● ● ● ● ●
● ● ● ● ●
● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ●
● ●
● ● ● ● ●
● ● ● ● ● ● ●
● ● ●
● ● ●
● ●
●
● ● ● ● ● ●● ● ● ● ● ● ● ● ●●
● ● ● ● ●
● ● ● ●
● ● ● ● ● ●
● ● ●
● ● ● ● ● ● ● ●
● ● ● ● ● ●
● ● ● ● ●
● ● ● ● ●
● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ●
● ●
● ● ● ● ●
● ● ● ● ● ● ●
● ● ●
● ● ●
● ●
●
● ● ● ● ● ●● ● ● ● ● ● ● ● ●●
● ● ● ● ●
● ● ● ●
● ● ● ● ● ●
● ● ●
● ● ● ● ● ● ● ●
● ● ●
● ● ● ● ● ● ● ●
● ●
● ● ● ● ●
● ● ● ● ● ● ● ● ●
● ●
●
● ● ● ● ● ● ●
● ● ● ● ●
● ● ● ● ● ● ●
● ● ●
● ● ●
● ●
●
● ● ●
●
●
● ● ● ●●
● ●
● ●
● ● ●●
●
● ●
● ● ●
● ● ● ●●
●
● ● ●
● ● ●
● ● ●
● ● ●
●
● ● ●
● ●
●
● ● ●
●
●
● ● ● ●●
● ●
● ●
● ● ●●
●
● ●
● ● ●
● ● ● ●●
●
● ● ●
● ● ●
● ● ●
● ● ●
●
● ● ●
● ●
●
data: shape$Murder
weights: nb2_W
data: shape$Murder
weights: nb2_B
Montecarlo Moran’s I
> [Link](1234)
> bperm=[Link](shape$Murder, listw=nb2_W, nsim=999)
> bperm
data: shape$Murder
weights: nb2_W
number of simulations + 1: 1000
Geary’s Coefficient
data: shape$Murder
weights: nb2_W
VA ● MD ●
10
Spatially Lagged Murder Rate
●
●
8
●
●
●
●
● ● DC ●
●
●
●
● ●
6
●
● ●
●
● ● ● ●●
●
●
● ●
●
● ● ● ●
4
●
●
●
● ● ● ●
●
● ●● ●
●
2
0 5 10 15 20 25 30
Murder Rate
● ●
1.0
Spatial Lag of shape$Murder
●
●
●
0.5
●
●
●● ● ●
●
●
●
●●
●
0.0
● ●
● ●
● ● ● ●●
●
● ●
●
●● ●●
●
●
−0.5
●
●●
Juan Sayago
●●● ESDA Class 2018-01 70 / 82
ESDA using R
● ●
1.0
Spatial Lag of shape$Murder
●
●
●
0.5
●
●
●● ● ●
●
●
●
●●
●
0.0
● ●
● ●
● ● ● ●●
●
● ●
●
●● ●●
●
●
−0.5
●
●● ●●
●
● ●● ●
●
●
−1.0
−1 0 1 2 3 4 5 6
shape$Murder
●
●
1.0
l Lag of shape$Robbery
0.5
●●
● ●●
● ●
● ●
●
● ●
● ●
●
●
● ●●
●
0.0
●
● ●
●
● ●●
●
●
● ●
Juan Sayago
●
● ●
● ESDA Class 2018-01 72 / 82
ESDA using R
●
●
1.0
Spatial Lag of shape$Robbery
0.5
●●
● ●●
● ●
● ●
●
● ●
● ●
●
●
● ●●
●
0.0
●
● ●
●
● ●●
●
●
● ●
● ●
● ●
● ●
−0.5
●
●
●●
● ● ●
●
−1.0
−1 0 1 2 3 4 5 6
shape$Murder
not significant
low−low
low−high
high−low
high−high
not significant
low−low
low−high
high−low
high−high
●
● ●
● ●
● ●
● ●
● ● ● ● ● ●
● ● ●
● ● ● ● ●
● ● ● ●● ● ●
● ● ● ● ● ●
●
● ● ● ● ●● ● ● ● ● ●
●
● ● ● ● ● ● ●
● ● ● ●
● ● ● ● ● ● ● ● ●
● ● ● ● ● ●
● ● ●● ● ● ●●●
● ● ● ● ● ● ●● ●
● ● ● ● ● ●● ● ●
● ●
● ●
●
● ● ● ● ●● ●ESDA ● ● ● ●●●●
Juan Sayago ● ● ● Class ● ● ●● 2018-01 79 / 82
ESDA using R
●
2.0
●
●
●
●
1.5
● ● ●
●
Spatial Lag of shapec$Bachelor
● ● ●
●
●
●● ●
●
●● ●
1.0
●
●
● ●
● ●
●
● ● ●
● ● ● ● ●
●
●● ● ●
● ● ● ●
●
0.5
●● ●● ● ●
● ● ● ● ●
● ●
●● ●
●
● ● ●● ●●● ●
●● ● ● ● ●
●
● ●● ● ●
● ●
−1.5 −1.0 −0.5 0.0
● ● ● ●
● ● ● ●
● ●● ● ● ●
●●● ● ●● ●
● ● ● ● ●● ●
● ●● ● ● ● ● ● ●
●
●●
● ● ● ● ●
●●●
●● ● ●●● ● ●
● ● ●●● ●
● ●
● ● ● ●● ●● ● ●
●●●
●● ●●●● ●●
● ● ●● ● ● ●●
● ● ●●
● ● ●● ● ● ●
● ● ●
● ● ●
●
●
●
● ●
●
−2 −1 0 1 2 3
shapec$Bachelor
not significant
low−low
low−high
high−low
high−high