Learn R Programming

geostan (version 0.8.1)

gr: The Geary Ratio

Description

An index for spatial autocorrelation. Complete spatial randomness (lack of spatial pattern) is indicated by a Geary Ratio (GR) of 1; positive autocorrelation moves the index towards zero, while negative autocorrelation will push the index towards 2.

Usage

gr(x, w, digits = 3, na.rm = FALSE, warn = TRUE)

Value

Returns the Geary ratio (a single numeric value).

Arguments

x

Numeric vector of length n. By default, this will be standardized using the scale function.

w

An n x n spatial connectivity matrix. See shape2mat.

digits

Number of digits to round results to.

na.rm

If na.rm = TRUE, observations with NA values will be dropped from both x and w.

warn

If FALSE, no warning will be printed to inform you when observations with NA values have been dropped, or if any observations without neighbors have been found.

Details

The Geary Ratio is an index of spatial autocorrelation. The numerator contains a series of sums of squared deviations, which will be smaller when each observation is similar to its neighbors. This term makes the index sensitive to local outliers, which is advantageous for detecting such outliers and for measuring negative autocorrelation. The denominator contains the total sum of squared deviations from the mean value. Hence, under strong positive autocorrelation, the GR approaches zero. Zero spatial autocorrelation is represented by a GR of 1. Negative autocorrelation pushes the GR above 1, towards 2. $$GR = \frac{n-1}{2K} \frac{M}{D}$$ $$M = \sum_i \sum_j w_{i,j} (x_i - x_j)^2 $$ $$D = \sum_i (x_i - \overline{x})^2 $$

Observations with no neighbors are removed before calculating the GR. (The alternative would be for those observations to contribute zero to the numerator---but zero is not a neutral value, it represents strong positive autocorrelation.)

Examples

Run this code
data(georgia)
x <- log(georgia$income)
w <- shape2mat(georgia, "W")
gr(x, w)


Run the code above in your browser using DataLab