CS计算机代考程序代写 Lecture 7: Spatial Autocorrelation (Local)

Lecture 7: Spatial Autocorrelation (Local)
Quantitative Methods II
Dr. Adams

Moran’s I
Global measure of spatial autocorrelation
􏰀 Single value calculated across all spatial units 􏰀 Points
􏰀 Polygons
􏰀 Measure of the overall clustering of the data. 􏰀 Assumes homogeneity.

Options for Moran’s I
􏰀 R, spdep::moran.mc()
􏰀 ArcGIS, Spatial Statistics toolbox -> Analyzing Patterns
toolset 􏰀 GeoDa

Crime
What if you wanted to know if crime hot spots were occuring?
Moran’s I, indicates clustering

G-Statistic
The G statistic distinguishes between hot spots and cold spots.
􏰀 Identifies spatial concentrations 􏰀 When G is relatively large
􏰀 high values clusters 􏰀 When G is relatively low
􏰀 low values clusters
Further reading: Getis, A. and Ord, J.K. (1992) The analysis of spatial association by use of distance statistics Geographical Analysis, 24(3) 189-206

Spatial Weights – Measuring Nearness
􏰀 Contiguity
􏰀 Binary (0/1)
􏰀 Zones that share boundaries = 1 􏰀 Distance
􏰀 Continuous
􏰀 Measure distance between points
􏰀 Historically, distance between polygon centroids

Weight Matrix Format
􏰀 Raw Matrix (0/1) 􏰀 Row standardized
􏰀 Divide each value by the row sum
􏰀 Adjusts for varying number of borders

Exercise: Weight Matrix

Matrix
Fill in a binary contiguity matrix
## A B C D E F G H row.sum
## A 0
##B ##C ##D ##E ##F ##G ##H
0
0
0
0
0
0
0

Contiguity Issues
􏰀 Polygons that are close but do not share a border? 􏰀 Non border connections, e.g. bridges & tunnels
􏰀 Length of border?
􏰀 Calculate using the length of shared border 􏰀 More computation required

House Value, Moran’s I = 0.64333

Local Measures
Calculate a value for each observation
Motivation
􏰀 Different spatial patterns may occur across space 􏰀 Spatial Processes
See: Luc Anselin 1995 Local Indicators of Spatial Association-LISA Geographical Analysis 27: 93-115
Often global measures have an associated local measure

House Value, Local Moran’s I
6
5
4
3
2
1
0
−1

Local Moran’s I (LISA)
LISA: Local Indicator of Spatial Association
􏰀 We can map the LISA value for each polygon.
􏰀 How does spatial autocorrealation occur across space. 􏰀 Also, we can map out statistically significant polygons
􏰀 Each observation has a local I value and a test statistic.

Hot Spot Map – LISA
High−High High−Low Low−High Low−Low
Not Significant Missing Data

Local Moran’s I Calculation
Ii =zi􏰂wijzj j
where zi is the standardized values of xi
z i = x i − x ̄ σx
wij is the spatial weight for i and j
􏰅􏰄􏰄 1 􏰂N
σx =􏰃N
(xi −μ)2
i=1

Prepare
Poly_ID x z i
A ___ B ___ C ___ D ___ E ___ F ___ G ___ H ___
x ̄ =?

LocalMoran’sIforD,EandC-σx =1.65
Ii =zi􏰁jwijzj |zi =xi−x ̄ σx

Local Moran’s I Statistical Significance
􏰀 Statistical significance is calculated through simulations. 􏰀 It may differ slightly each time it is calculated
􏰀 Available in ArcGIS

Significance Maps in R
High−High High−Low Low−High Low−Low
Not Significant Missing Data

Code in R
## Load plot.local.moran function source(“https://raw.githubusercontent.com/gisUTM/
spatialplots/master/plotlocalmoran.R”) polyNB <- poly2nb(polys) weights <- nb2listw(polyNB) LISA <- localmoran(polys@data$houseValue, weights, na.action = na.exclude) plot.local.moran(polys, "houseValue", LISA, weights = weights)