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)

Source

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.

Arguments

x

Numeric vector of length n. By default, this will be standardized using the scale function.

w

An n x n spatial connectivity matrix. See shape2mat.

digits

Number of digits to round results to.

scale

If TRUE, then x will automatically be standardized using scale(x, center = TRUE, scale = TRUE).

na.rm

If na.rm = TRUE, observations with NA values will be dropped from both x and w.

warn

If FALSE, no warning will be printed to inform you when observations with NA values have been dropped, or if any observations without neighbors have been found.

Value

The function returns a vector of numeric values, each value being a local indicator of spatial association (or dissimilarity), ordered as x.

Details

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 will also increase the value of the local Geary statistic. For most purposes, the row-standardized spatial weights matrix may be the more appropriate choice.

Examples

library(ggplot2)
data(georgia)
x <- log(georgia$income)
w <- shape2mat(georgia, "W")
lisd <- lg(x, w)
hist(lisd)
ggplot(georgia) +
  geom_sf(aes(fill = lisd)) +
scale_fill_gradient(high = "navy",  
                   low = "white") 
 ## or try: scale_fill_viridis()