Professional Documents
Culture Documents
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Maurizio Pisati
1/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Outline
1
Introduction
Spatial data
Maurizio Pisati
2/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Outline
4
References
Maurizio Pisati
3/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Introduction
Maurizio Pisati
4/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
5/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Esda in Stata
Maurizio Pisati
6/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Esda in Stata
spmap is a general command aimed at visualizing several
weights matrices
spatgsa computes global indices of spatial autocorrelation
spatlsa computes local indices of spatial autocorrelation
Maurizio Pisati
7/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Spatial data
Maurizio Pisati
8/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
objects
Field view : Space as an area covered with essentially
continuous surfaces
Here we take the former view and define spatial data as
Maurizio Pisati
9/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
categories:
Spatial attributes
Non-spatial attributes
Maurizio Pisati
10/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Maurizio Pisati
11/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Points
Homicides
Washington D.C. (2009)
A point si is a zero-dimensional
Maurizio Pisati
12/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Polygons
A polygon ri is a region of study
Police Districts
Washington D.C.
Fourth
Second
Third
Fifth
First
Sixth
Seventh
13/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
14/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Mapping
Maurizio Pisati
15/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Thematic maps
Maurizio Pisati
16/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
17/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
18/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Dot maps
Maurizio Pisati
19/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
20/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
!"#$%&'()#*++,-./0%!$12#0'$
3#4#'0/#$567$"$#$$
3#4#'0/#$8(1/()$"$)#/9:.$
'#1:.#$8(1/()$%&'(")*%)(')+",*%-".*$
20;#2$.#<(4#$8(1/()$)$%=.!2/%$,$%&9(2.%$
20;#2$802!#"$8(1/()$8(1/()$
">)0>$!"(43$%?:!4.0'(#"-./0%!$(.%567*$<1:2:'%#33"9#22*$$$$$$'''$
$$$>:(4/%@%@51::'.*$A%A51::'.*$"#2#1/%B##>$(<$:<<#4"#""/*$$$'''$
$$$$$;A%8(1/()*$"(C#%-).,*$<1:2:'%'#.$408A*$$$$$$$$$$$$$$$$$'''$
$$$$$:1:2:'%D9(/#$..*$:"(C#%-0.1$..*$2#3#4.0%:4*$$$$$$$$$$$$'''$
$$$$$2#31:!4/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'''$
$$$2#3#4.%"(C#%-).+*$':D30>%).,**$$$$$$$$$$$$$$$$$$$$$$$$$$$'''$
$$$/(/2#%%E#@$0;!"#"F$;A$8(1/()$03#%!$"(C#%-).,**$$$$$$$$$$$'''$
$$$"!;/(/2#%%G0"9(43/:4$7-&-$H*++,I%$%$%!$"(C#%-).,**!
Adult (155)
Child (204)
Maurizio Pisati
21/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
22/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
23/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
!"#$%&'()*#+)",-)*,".+/,/01,/%!$*(#/-$
2#3#-/,#$4$"$)3*'5#65/#$%%%$
7'-5/,$4$&'($7$
"85/8$!")32$%&'()*#+)",-)*,".9''-1)3/,#"01,/%!$)1))1*$$$$$$$###$
$$$7*'('-)#22":#((*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$###$
$$$8')3,););6*''-1*$<)<6*''-1*$8-'8'-,)'3/()4*$7*'('-)-#1*$$###$
$$$$$'*'('-)=:),#*$")>#)+,(-**$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$###$
$$$(/?#(););6*''-1*$<*''-1)<6*''-1*$(/?#()4*$*'('-)=:),#*$$$###$
$$$$$")>#)+$('**$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$###$
$$$,),(#)%@#/3$7/5)(<$)3*'5#$A)3$,:'!"/31"$'7$BC$1'((/-"D%*$###$
$$$"!?,),(#)%E/":)32,'3$+090$AFGGGD%$%$%*!
51.5
22.7
14.0
26.1
12.7
8.1
Maurizio Pisati
24/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
!"#$%&#'"!"()))*+,-,./-,%!$01#,2$
3#'#2,-#$4$"$5'067#87,#$%%%$
"97,9$!"5'3$%&#'"!"()))*&662/5',-#"./-,%!$5/&5/'$$$$$$$$$$$###$
$$$:06162!";#11'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$###$
$$$965'-&<&<80662/'$=&=80662/'$:06162&2#/'$606162&>;5-#'$$$###$
$$$$$"5?#&(%)*'$/#@5,-56'&4'$2#:>#53;-&969-6-''$$$$$$$$$$$$###$
$$$-5-1#&%A#,'$:,751=$5'067#%'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$###$
$$$"!B-5-1#&%C,";5'3-6'$+.&.$D()))E%$%$%'!
Maurizio Pisati
25/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Diagram maps
Maurizio Pisati
26/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
27/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
!"#$%&'()*#+)",-)*,".+/,/01,/%!$*(#/-$
2#3#-/,#$45),#67*,$"$7'7645),##7'7,',$%&&$
2#3#-/,#$/8-'/967*,$"$7'76/8-'/9#7'7,',$%&&$
2#3#-/,#$',5#-67*,$"$7'76',5#-#7'7,',$%&&$
(/:#($;/-)/:(#$45),#67*,$%<5),#%$
(/:#($;/-)/:(#$/8-'/967*,$%=8-)*/3$=9#-)*/3%$
(/:#($;/-)/:(#$',5#-67*,$%>,5#-%$
"79/7$!")32$%&'()*#+)",-)*,".?''-1)3/,#"01,/%!$)1')1($$$$$$$###$
$$$8*'('-'",'3#($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$###$
$$$1)/2-/9';/-'45),#67*,$/8-'/967*,$',5#-67*,($@'@6*''-1($$$###$
$$$$$A'A6*''-1($8*'('-'#22"5#(($-#1$'-/32#($")B#'%)*($$$$$$$###$
$$$$$(#2#31/''3(($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$###$
$$$(#2#31'")B#'$%)+(($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$###$
$$$,),(#'%C/*#DE,53)*$*'97'"),)'3$'8$,5#$7'7!(/,)'3%($$$$$$$###$
$$$"!:,),(#'%</"5)32,'3$+0?0$FGHHHI%$%$%(!
White
African American
Other
Maurizio Pisati
28/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Choropleth maps
Maurizio Pisati
29/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
30/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
31/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
32/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
(110,341]
(59,110]
(9,59]
[6,9]
Missing
Maurizio Pisati
33/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Multivariate maps
Maurizio Pisati
34/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
35/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Dot maps
Proportional symbol maps
Diagram maps
Choropleth maps
Multivariate maps
Maurizio Pisati
36/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
Maurizio Pisati
37/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
region
Points si are referred to as the data points
Maurizio Pisati
38/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
Maurizio Pisati
39/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
Maurizio Pisati
40/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
Kernel estimators
Both the probability density function p(s) and the intensity
41/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
N
d(si , sg )
c X
(sg ) =
k
yi
Ag
hi
i=1
42/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
is estimated by:
p(sg ) =
g)
(s
G
P
j)
(s
j=1
Maurizio Pisati
43/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
44/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
Maurizio Pisati
45/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
Step 1
We use spgrid to generate a grid
covering the area of Washington D.C. We
choose a relatively fine grid resolution
(grid cell width = 200 meters). spmap is
used to display the grid
!"#$%&'(!%)#'*+,()&-$%.!/&0-*!'$.!,1(0%,)"2344#''''$$$'
'''&,0!'5,6"$.!!'()%0"6.0.$!#'5.11!"*50.6"/&0-*#'''$$$'
'''",%)0!"*"0.6"/&0-*#'$."1-5.'
'
(!.'*"0.6"/&0-*!'51.-$'
!"6-"'(!%)#'*50.6"/&0-*!'%&"!"#$%&7%&#!
Maurizio Pisati
46/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
Homicides
Washington D.C. (2009)
!"#$%&'()#*++,-./0%!$12#0'$
3##4$(5$655#7"#""#$
"43.#$!"(78$%4/#)4-./0%!$9$9:166'.%$;$;:166'.%$$$&&&$
$$$3#'7#2$<!0'/(1%$=07.>(./?$5=>%$5=>$'(((%$$$$$$&&&$
$$$#.8#16''#1/$.6/"$"0@(78$%3.#-./0%!$'#4201#%$
$
!"#$%3.#-./0%!$12#0'$
"4)04$4$!"(78$%1/#)4-./0%!$(.$"48'(.:(.%$12)#/?6.$<!07/(2#%$&&&$
$$$127!)=#'$)(%$51626'$A0(7=6>%$61626'$767#$**%$2#8#7.$655%$&&&$
$$$/(/2#$%B6)(1(.#"%!$"(C#$+'*)%%$$$$$$$$$$$$$$$$$$$$$$$$$$$&&&$
$$$"!=/(/2#$%D0"?(78/67$E-&-$F*++,G%$%$%!$"(C#$+'*)%%!
Maurizio Pisati
47/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Kernel density estimation
Homicides
Washington D.C. (2009)
!"#$%&'()#*++,-./0%!$12#0'$
3##4$(5$655#7"#""#$
"43.#$!"(78$%4/#)4-./0%!$9$9:166'.%$;$;:166'.%$$$&&&$
$$$3#'7#2$<!0'/(1%$=07.>(./?$5=>%$5=>$'(((%$$$$$$&&&$
$$$#.8#16''#1/$.6/"$"0@(78$%3.#-./0%!$'#4201#%$
$
!"#$%3.#-./0%!$12#0'$
"4)04$4$!"(78$%1/#)4-./0%!$(.$"48'(.:(.%$12)#/?6.$<!07/(2#%$&&&$
$$$127!)=#'$)(%$51626'$A0(7=6>%$61626'$767#$**%$2#8#7.$655%$&&&$
$$$/(/2#$%B6)(1(.#"%!$"(C#$+'*)%%$$$$$$$$$$$$$$$$$$$$$$$$$$$&&&$
$$$"!=/(/2#$%D0"?(78/67$E-&-$F*++,G%$%$%!$"(C#$+'*)%%!
Maurizio Pisati
48/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
49/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Spatial autocorrelation
Forty years ago, the geographer and statistician Waldo
50/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
51/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
wij
N
P
wij
j=1
Maurizio Pisati
52/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
53/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
to area data
Measures of spatial autocorrelation can be classified into
two broad categories:
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
54/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
55/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
56/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Morans I
Morans global index of spatial autocorrelation I (Moran
I=
i=1 j=1
1
N
N
P
(yi y)2
i=1
N P
N
P
wij
i=1 j=1
where wii = 0
Maurizio Pisati
57/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Morans I
1
N 1
Maurizio Pisati
58/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
G=
wij yi yj
i=1 j=1
N P
N
P
(i 6= j)
yi yj
i=1 j=1
Maurizio Pisati
59/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
E(G) =
wij
i=1 j=1
N (N 1)
60/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
61/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
62/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Step 1
We use spatwmat to import an existing binary spatial weights matrix
stored in the Stata dataset Counties-Contiguity.dta and
convert it into a properly formatted row-standardized spatial weights
matrix Ws
!"#$%&#$'(!)*+',-.(*$)/!0-.*$)+()$123$#,!'''"""'
'''*#&/#4!$'!$#*3#53)6/!
Maurizio Pisati
63/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
r: Maurizio
Maurizio Pisati
64/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Step 2
We use spatgsa with the spatial weights matrix Ws to compute
Morans I on the variables of interest
!"#$%&'!()*#"+,-)-./)-%!$01#-2$
"3-)4"-$30)53''26#-1)6$30)50!22"7'8#2$30)56*91''/32"$$$"""$
$$$30)5'9#"#!$:#;"$$7'2-(!
Maurizio Pisati
65/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
User: Maurizio
Weights matrix
Name: Ws
Type: Imported (binary)
Row-standardized: Yes
Moran's I
Variables
pct_poorhealth
pct_currsmoker
pct_hibloodprs
pct_obese
I
0.399
0.339
0.126
0.167
E(I)
sd(I)
p-value*
-0.011
-0.011
-0.011
-0.011
0.065
0.065
0.065
0.065
6.337
5.367
2.119
2.730
0.000
0.000
0.017
0.003
*1-tail test
Maurizio Pisati
66/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Step 3
We use again spatwmat to import the binary spatial weights matrix
stored in the Stata dataset Counties-Contiguity.dta. This time,
however, we convert it into a properly formatted non-standardized
spatial weights matrix W
!"#$%&#$'(!)*+',-.(*$)/!0-.*$)+()$123$#,!'''"""'
'''*#&/#4$!
Maurizio Pisati
67/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
68/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Step 4
We use spatgsa with the spatial weights matrix W to compute Getis
and Ords G on the variables of interest
!"#$%&'!()*#"+,-)-./)-%!$01#-2$
"3-)4"-$30)53''26#-1)6$30)50!22"7'8#2$30)56*91''/32"$$$"""$
$$$30)5'9#"#!$:#;$$4'!
Maurizio Pisati
69/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
User: Maurizio
Global
indices of spatial autocorrelation: example
Weights matrix
Name: W
Type: Imported (binary)
Row-standardized: No
E(G)
sd(G)
p-value*
0.061
0.060
0.060
0.061
0.060
0.060
0.060
0.060
0.001
0.001
0.000
0.000
0.372
-0.392
-1.585
0.458
0.355
0.348
0.056
0.323
*1-tail test
Maurizio Pisati
70/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
71/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Morans Ii
as follows:
Ii =
N
X
std
wij
j=1
yi y
y
yj y
y
std
where y denotes the standard deviation of Y ; and wij
denotes the elements of a row-standardized spatial weights
std = 0
matrix, with wii
Maurizio Pisati
72/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Morans Ii
Maurizio Pisati
73/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
is defined as follows:
N
P
Gi =
wij yj
j=1
N
P
(i 6= j)
yj
j=1
Maurizio Pisati
74/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Gi * is defined as follows:
N
P
G?i
wij yj
j=1
N
P
yj
j=1
Maurizio Pisati
75/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
hot spot
If Gi < E(Gi ) or G?i < E(G?i ), then region ri represents a
cold spot
Maurizio Pisati
76/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
77/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
78/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Step 1
We use spatlsa with the standardized spatial weights matrix Ws
previously generated by spatwmat to compute Morans Ii on the
variable of interest. In the output, counties are sorted by z -value
!"#$%&#$'(!)*+',-.(*$)/!0-.*$)+()$123$#,!'*#&/"4!#'!$#*3#53)6/'
(!/',-.(*$)/!07#$#23$#,!'89/#5'
!"#$9!#'"8$:"..5;/#9$;!'%"4!#'&.5#*')3"*#&/#'!.5$!
Maurizio Pisati
79/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
E(Ii)
sd(Ii)
p-value*
-0.816
-0.760
-1.089
-0.457
Ii
-0.011
-0.011
-0.011
-0.011
0.358
0.358
0.560
0.358
-2.246
-2.090
-1.924
-1.244
0.012
0.018
0.027
0.107
0.545
0.927
0.677
0.908
0.949
1.087
1.246
2.433
2.197
3.578
5.503
3.911
5.400
-0.011
-0.011
-0.011
-0.011
-0.011
-0.011
-0.011
-0.011
-0.011
-0.011
-0.011
-0.011
-0.011
0.358
0.560
0.389
0.482
0.358
0.358
0.389
0.482
0.429
0.482
0.560
0.389
0.482
1.555
1.675
1.769
1.906
2.682
3.067
3.230
5.069
5.150
7.442
9.844
10.077
11.220
0.060
0.047
0.038
0.028
0.004
0.001
0.001
0.000
0.000
0.000
0.000
0.000
0.000
(Output omitted)
Hancock
Williams
Delaware
Mercer
Putnam
Henry
Vinton
Gallia
Pike
Adams
Lawrence
Jackson
Scioto
*1-tail test
Maurizio Pisati
80/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Step 2
We use Stata command genmsp a simple wrapper to spatlsa
(source code in Appendix) to generate the variables required for
drawing the Moran scatterplot and the corresponding cluster map
(Anselin 1995)
!"#$%&'&()*&++,-"./)-!'0"1%#!
Maurizio Pisati
81/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Maurizio Pisati
82/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Lawrence
Gallia
Pike
Jackson
Vinton
Adams
Ross Brown
Highland
Athens
Meigs
Wz
Belmont
Jefferson
Guernsey
Pickaway
Noble
Muskingum
Fairfield Carroll
Morgan
Harrison
Richland
MorrowWashington
Tuscarawas
Greene
WyandotFayette
Clark Columbiana
Miami
Union
Monroe
Coshocton
Mahoning
Clermont Huron
SenecaButler
Clinton
Crawford
Erie
Lake Portage
Champaign
Warren
Ashland
Logan
Stark
Trumbull
Ottawa
Montgomery Preble
Medina
Darke
Lorain Geauga
Sandusky
Delaware
Ashtabula
Madison
Marion
Mercer
Summit
Hamilton
Putnam
Allen Auglaize
Knox
Shelby
Cuyahoga
Hancock
Defiance
Franklin
Lucas
Wood
Henry
Hardin
Fulton
Van Wert Wayne
Williams
Paulding
Licking
Holmes
-1
Hocking
Perry
-2
-2
-1
z
Maurizio Pisati
83/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Step 4
We use spmap to draw the cluster map corresponding to the Moran
scatterplot
!"#$"%#!"&"'(&"))*+,$-(+%.!/01%23).0(/,!43))*5/0$(,!65($2!%%"""%
%%%/5#/5$%'-#,(+)5#.0/7.,$%8')-)*#9-.,%*,5%&'(%*,5$%%%%%%%%%"""%
%%%-$9,-#:#:&'))*5$%;#;&'))*5$%-$9,-#0$#,$%')-)*#<+/(,$%%%%%"""%
%%%%%!/=,#%&')$%!,-,'(#>,,"%/8%#!"&"'(&"))*+,$-(+*+'$$%%%%%%"""%
%%%-,1,05#)88$!
Maurizio Pisati
84/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Overview
Spatial weights matrices
Measuring spatial autocorrelation
Global indices of spatial autocorrelation
Local indices of spatial autocorrelation
Hardin
Mercer
Knox
Delaware
Vinton
Pike
Adams
Scioto
Jackson
Gallia
Lawrence
Maurizio Pisati
85/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
References
Maurizio Pisati
86/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
References I
Anselin, L. 1995. Local indicators of spatial association LISA.
Geographical Analysis 27: 93115.
Bailey, T.C. and A.C. Gatrell. 1995. Interactive Spatial Data Analysis.
Harlow: Longman.
Getis, A. and J.K. Ord. 1992. The analysis of spatial association by use of
distance statistics. Geographical Analysis 24: 189206.
Haining, R., Wise, S. and J. Ma. 1998. Exploratory spatial data analysis in
a geographic information system environment. The Statistician 47: 457469.
Pfeiffer, D., Robinson, T., Stevenson, M., Stevens, K., Rogers, D. and A.
Clements. 2008. Spatial Analysis in Epidemiology. Oxford: Oxford
University Press.
Pisati, M. 2001. sg162: Tools for spatial data analysis. Stata Technical
Bulletin 60: 2137. In Stata Technical Bulletin Reprints, vol. 10, 277298.
College Station, TX: Stata Press.
Maurizio Pisati
87/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
References II
Slocum, T.A., McMaster, R.B., Kessler, F.C. and H.H. Howard. 2005.
Thematic Cartography and Geographic Visualization. 2nd ed. Upper Saddle
River, NJ: Pearson Prentice Hall.
Waller, L.A. and C.A. Gotway. 2004. Applied Spatial Statistics for Public
Health Data. Hoboken, NJ: Wiley.
Maurizio Pisati
88/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Appendix
Maurizio Pisati
89/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
90/91
Introduction
Spatial data
Visualizing spatial data
Exploring spatial point patterns
Detecting spatial autocorrelation
References
Wstd_Y<0 &
Wstd_Y>0 &
Wstd_Y<0 &
Wstd_Y>0 &
3 "High-Low"
pval_Y<pvalue
pval_Y<pvalue
pval_Y<pvalue
pval_Y<pvalue
4 "High-High", modify
end
exit
Maurizio Pisati
91/91