lg | R Documentation |
A local indicator of spatial association based on the Geary Ratio (Geary's C) for exploratory spatial data analysis. Large values of this statistic highlight local outliers, that is, values that are not like their neighbors.
lg(x, w, digits = 3, scale = TRUE, na.rm = FALSE, warn = TRUE)
x |
Numeric vector of length |
w |
An |
digits |
Number of digits to round results to. |
scale |
If |
na.rm |
If |
warn |
If |
Local Geary's C is found in the numerator of the Geary Ratio (GR). For the i^{th}
observation, the local Geary statistic is
C_i = \sum_j w_{i,j} * (x_i - x_j)^2
Hence, local Geary values will be largest for those observations that are most unlike their neighboring values. If a binary connectivity matrix is used (rather than row-standardized), then having many neighbors can also increase the value of the local Geary statistic. For most purposes, the row-standardized spatial weights matrix may be the more appropriate choice.
The function returns a vector of numeric values, each value being a local indicator of spatial association (or dissimilarity), ordered as x
.
Anselin, Luc. "Local indicators of spatial association—LISA." Geographical analysis 27, no. 2 (1995): 93-115.
Chun, Yongwan, and Daniel A. Griffith. Spatial Statistics and Geostatistics: Theory and Applications for Geographic Information Science and Technology. Sage, 2013.
library(ggplot2)
data(georgia)
x <- log(georgia$income)
w <- shape2mat(georgia, "W")
lisa <- lg(x, w)
hist(lisa)
ggplot(georgia) +
geom_sf(aes(fill = lisa)) +
scale_fill_gradient(high = "navy",
low = "white")
## or try: scale_fill_viridis()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.