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=zij∑wijzj
(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. So the geostan version can be made equal to the spdep version by dividing by that value.