| lisa | R Documentation |
A local indicator of spatial association (LISA) based on Moran's I (the Moran coefficient) for exploratory data analysis.
lisa(x, w, type = TRUE, scale = TRUE, digits = 3)
x |
Numeric vector of length |
w |
An |
type |
Return the type of association also (High-High, Low-Low, High-Low, and Low-High)? Defaults to |
scale |
If |
digits |
Number of digits to round results to. |
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:
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 \sum_i z_i^2/n. So the geostan version can be made equal to the spdep version by dividing by that value.
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.
Anselin, Luc. "Local indicators of spatial association—LISA." Geographical Analysis 27, no. 2 (1995): 93-115.
moran_plot, mc, aple, lg, gr
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.