geary function

Compute Geary's C

Compute Geary's C

A simple function to compute Geary's C, called by geary.test and geary.mc; [REMOVE_ME]C=(n1)2i=1nj=1nwiji=1nj=1nwij(xixj)2i=1n(xixˉ)2[REMOVEME2] C = \frac{(n-1)}{2\sum_{i=1}^{n}\sum_{j=1}^{n}w_{ij}}\frac{\sum_{i=1}^{n}\sum_{j=1}^{n}w_{ij}(x_i-x_j)^2}{\sum_{i=1}^{n}(x_i - \bar{x})^2} [REMOVE_ME_2]

geary.intern is an internal function used to vary the similarity criterion.

Description

A simple function to compute Geary's C, called by geary.test and geary.mc;

C=(n1)2i=1nj=1nwiji=1nj=1nwij(xixj)2i=1n(xixˉ)2 C = \frac{(n-1)}{2\sum_{i=1}^{n}\sum_{j=1}^{n}w_{ij}}\frac{\sum_{i=1}^{n}\sum_{j=1}^{n}w_{ij}(x_i-x_j)^2}{\sum_{i=1}^{n}(x_i - \bar{x})^2}

geary.intern is an internal function used to vary the similarity criterion.

geary(x, listw, n, n1, S0, zero.policy=attr(listw, "zero.policy"), scale=TRUE)

Arguments

  • x: a numeric vector the same length as the neighbours list in listw

  • listw: a listw object created for example by nb2listw

  • n: number of zones

  • n1: n - 1

  • S0: global sum of weights

  • zero.policy: default attr(listw, "zero.policy") as set when listw was created, if attribute not set, use global option value; if TRUE assign zero to the lagged value of zones without neighbours, if FALSE assign NA

  • scale: default TRUE, may be FALSE to revert changes made to accommodate localC in November 2021 (see #151)

Returns

a list with - C: Geary's C

  • K: sample kurtosis of x

References

Cliff, A. D., Ord, J. K. 1981 Spatial processes, Pion, p. 17.

Author(s)

Roger Bivand Roger.Bivand@nhh.no

See Also

geary.test, geary.mc, sp.mantel.mc

Examples

data(oldcol) col.W <- nb2listw(COL.nb, style="W") str(geary(COL.OLD$CRIME, col.W, length(COL.nb), length(COL.nb)-1, Szero(col.W)))