Skip to content

locgi

Local G and G of Getis and Ord*

locgi(x, w, star = TRUE)

The local statistics of Getis and Ord (1992) as z values (Ord and Getis 1995): G_i compares the weighted sum of the neighbours’ values with its expectation from the other n - 1 values; G*_i (star = TRUE) includes the unit itself with weight 1 and uses all n. Large positive values mark concentrations of high values, large negative ones of low values. With star = TRUE the weights are best binary (style = "raw").

x

The values: finite numbers, one per unit.

w

The weights: spwt()’s list, or an spdep listw object, for as many units as x.

star

TRUE for G*, FALSE for G.

A numeric vector of z values, one per unit; NaN for a unit without neighbours.

Ord, J. K. and Getis, A. (1995). Local spatial autocorrelation statistics: distributional issues and an application. Geographical Analysis, 27(4), 286-306. doi:10.1111/j.1538-4632.1995.tb00912.x

set.seed(1)
p <- cbind(x = runif(60), y = runif(60))
v <- rpois(60, ifelse(p[, 1] > 0.7, 6, 2))
locgi(v, spwt(p, type = "band", d = 0.2, style = "raw"))

Generated from the R help page: locgi in the R reference.