lisa function

Local Moran's I

Local Moran's I

A local indicator of spatial association (LISA) based on Moran's I (the Moran coefficient) for exploratory data analysis.

Source

Anselin, Luc. "Local indicators of spatial association—LISA." Geographical Analysis 27, no. 2 (1995): 93-115.

lisa(x, w, type = TRUE, scale = TRUE, digits = 3)

Arguments

  • x: Numeric vector of length n.
  • w: An n x n spatial connectivity matrix. See shape2mat . If w is not row standardized (all(Matrix::rowSums(w) == 1)), it will automatically be row-standardized.
  • type: Return the type of association also (High-High, Low-Low, High-Low, and Low-High)? Defaults to FALSE.
  • scale: If TRUE, then x will automatically be standardized using scale(x, center = TRUE, scale = TRUE). If FALSE, then the variate will be centered but not scaled, using scale(x, center = TRUE, scale = FALSE).
  • digits: Number of digits to round results to.

Returns

If type = FALSE a numeric vector of lisa values for exploratory analysis of local spatial autocorrelation. If type = TRUE, a data.frame with columns Li (the lisa value) and type.

Details

The values of x will automatically be centered first with z = scale(x, center = TRUE, scale = scale) (with user control over the scale argument). The LISA values are the product of each z value with the weighted sum of their respective surrounding value:

Ii=zijwijzj I_i = z_i \sum_j w_{ij} z_j

(or in R code: lisa = z * (w %*% z)). These are for exploratory analysis and model diagnostics.

An above-average value (i.e. positive z-value) with positive mean spatial lag indicates local positive spatial autocorrelation and is designated type "High-High"; a low value surrounded by high values indicates negative spatial autocorrelation and is designated type "Low-High", and so on.

This function uses Equation 7 from Anselin (1995). Note that the spdep package uses Formula 12, which divides the same value by a constant term izi2/n\sum_i z_i^2/n. So the geostan version can be made equal to the spdep version by dividing by that value.

Examples

library(ggplot2) library(sf) data(georgia) w <- shape2mat(georgia, "W") x <- georgia$ICE li = lisa(x, w) head(li) ggplot(georgia, aes(fill = li$Li)) + geom_sf() + scale_fill_gradient2()

See Also

moran_plot, mc, aple, lg, gr

  • Maintainer: Connor Donegan
  • License: GPL (>= 3)
  • Last published: 2024-12-04