gearc
Geary’s C
gearc(x, w, nsim = 0, seed = NULL)Geary’s (1954) contiguity ratio of values on units with spatial weights
w: C = (n - 1) sum w_ij (x_i - x_j)^2 / (2 S0 sum (x_i - xbar)^2), 1
under no autocorrelation, below 1 when neighbours are alike. Its variance
is given under normality and under randomisation (Cliff and Ord 1981),
with z statistics (1 - C) / sd and their upper normal tails, and, with
nsim > 0, a permutation p-value against positive autocorrelation.
That C has expectation 1 under randomisation is proved in Lean: see
proof("gearc").
Parameters
Section titled “Parameters”xThe values: finite numbers, one per unit.
wThe weights:
spwt()’s list, or an spdeplistwobject, for as many units asx.nsimThe number of permutations: a whole number from 0.
seedNULLto draw the simulations’ seed from R’s generator (soset.seed()fixes them), or one whole number from 0.
Returns
Section titled “Returns”A named numeric vector: c, vn and vr (its variance under
normality and randomisation), zn, zr, pn, pr, pperm
((1 + #{C* <= C}) / (nsim + 1), NaN without permutations) and s0
(the sum of the weights).
References
Section titled “References”Geary, R. C. (1954). The contiguity ratio and statistical mapping. The Incorporated Statistician, 5(3), 115-145. doi:10.2307/2986645
Cliff, A. D. and Ord, J. K. (1981). Spatial Processes: Models and Applications. Pion, London.
Examples
Section titled “Examples”set.seed(1)p <- cbind(x = runif(50), y = runif(50))gearc(p[, 1] + p[, 2] + rnorm(50, sd = 0.1), spwt(p, k = 4))Generated from the R help page: gearc in the R reference.