getisord: Calculate Global Getis-Ord statistic

getisordR Documentation

Calculate Global Getis-Ord statistic

Description

Calculating the Global Getis-Ord statistic for hotspot analysis from an nbmatrix object

Usage

getisord(
  object,
  alternative = "greater",
  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 spdep::globalG.test

verbose

bool argument which indicates whether progress messages are displayed

Details

The Global Getis-Ord statistic (Getis & Ord 1992) is a statistical measure of spatial association that assesses the spatial concentration of high or low values. Its calculation requires a spatial weights matrix that defines the spatial relationships between observations and assigns weights to neighboring observations (e.g., binary weights based on contiguity). A typical application is, for example, investigating whether high or low incidence of infectious diseases is spatially clustered, that is, whether areas with high (or low) incidence tend to be surrounded by neighboring areas that also exhibit high (or low) incidence. This function internally uses spdep::globalG.test 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

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

GeoDa Center (2026) GeoDa. An Introduction to Spatial Data Science. https://geodacenter.github.io/

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")}

See Also

nbmatrix, 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 <- getisord(
  Corona_nbstat2,
  verbose = TRUE
)
# Calculating Global Getis-Ord statistic

summary(Corona_SpatialStatistics)
# Summary of nbmatrix object

swash documentation built on Oct. 18, 2026, 5:06 p.m.