moran_local: Calculate Local Moran's I statistic

moran_localR Documentation

Calculate Local Moran's I statistic

Description

Calculating the Local Moran's I for detecting local spatial autocorrelation from an nbmatrix object

Usage

moran_local(
  object,
  alternative = "greater",
  nsim = 999,
  verbose = FALSE
  )

Arguments

object

Object of class nbmatrix

alternative

a character string specifying the alternative hypothesis, must be one of "greater" (default), "less" or "two.sided"; passed to sfdep::local_moran

nsim

numeric value with number of simulations to run; passed to sfdep::local_moran

verbose

bool argument which indicates whether progress messages are displayed

Details

Unlike the global Moran's I statistic, which measures spatial autocorrelation across the entire study area, the local Moran's I statistic (Anselin 1995) is calculated for each spatial unit individually. Based on the resulting test statistics, z-scores, and p-values, the analysis identifies local patterns of spatial association, including clusters of regions with similarly high (High-High) or low (Low-Low) values, as well as spatial outliers where high values are surrounded by low values (High-Low) or vice versa (Low-High). A typical application is investigating whether high or low incidences of infectious diseases are spatially clustered, thereby identifying statistically significant hotspots and coldspots. This function internally uses sfdep::local_moran for calculation (see the corresponding documentation). The results are written in the nbmatrix instance and displayed in the summary.

Value

object of class nbmatrix-class

Author(s)

Thomas Wieland

References

Anselin L (1995) Local Indicators of Spatial Association—LISA. Geographical Analysis, 27(2), 93–115. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1111/j.1538-4632.1995.tb00338.x")}

Cliff AD, Ord JK (1981) Spatial Processes: Models & Applications. https://archive.org/details/spatialprocesses0000clif

Getis A, Ord JK (1992). The analysis of spatial association by use of distance statistics. Geographical Analysis 24 (3), 189–206. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1111/j.1538-4632.1992.tb00261.x")}

Ord JK, Getis A (1995) Local Spatial Autocorrelation Statistics: Distributional Issues and an Application. Geographical Analysis 27, 286-306. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1111/j.1538-4632.1995.tb00912.x")}

Rotejanaprasert C, Chinpong K, Lawson AB, Chienwichai P, Maude RJ (2024) Evaluation and comparison of spatial cluster detection methods for improved decision making of disease surveillance: a case study of national dengue surveillance in Thailand. BMC Medical Research Methodology 24, 14. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1186/s12874-023-02135-9")}

See Also

nbmatrix, getisord, nbstat, moran, gstar

Examples

data(RKI_Corona_counties)
# German counties (Source: Robert Koch Institute)

Corona_nbmat <- 
  nbmatrix (
    RKI_Corona_counties, 
    ID_col="AGS",
    verbose = TRUE
  )
# Creating neighborhood matrix

Corona_nbstat2 <- nbstat(
  Corona_nbmat,
  link_data = RKI_Corona_counties, 
  ID_col = "AGS", 
  data_col = "cases_per_", 
  func = NULL,
  verbose = TRUE
  )
# New nbmatrix instance
# Defining "cases_per_" (COVID-19 cases per 100,000 inhabitants) as analysis column

Corona_SpatialStatistics <- moran_local(
  Corona_nbstat2,
  verbose = TRUE
)
# Calculating Local Moran's I

summary(Corona_SpatialStatistics)
# Summary of nbmatrix object

swash documentation built on Nov. 28, 2026, 5:14 p.m.