Skip to contents

Computes the Getis-Ord \(G_i^*\) z-score at each site (sums include j = i; population standard deviation), converts to two-sided normal p-values \(p_i = 2(1 - \Phi(|z_i|))\), screens them with the Benjamini-Hochberg step-up rule at level alpha, and classifies each site as hot (+1, positive significant), cold (-1, negative significant) or neither (0).

Usage

Hotcld(x, W, alpha = 0.05)

hot_cold_spots(x, W, alpha = 0.05)

Arguments

x

Observed values, length n.

W

Spatial weights matrix, n by n; the diagonal may be nonzero (self-weights are part of the star statistic).

alpha

FDR level for the Benjamini-Hochberg screen.

Value

List with z, p, significant, category, n_hot, n_cold, alpha, n.

Details

The \(G_i^*\) z-score is \((\sum_j w_{ij} x_j - \bar x \sum_j w_{ij}) / (s \sqrt{(n \sum_j w_{ij}^2 - (\sum_j w_{ij})^2)/(n-1)})\) with \(s\) the population standard deviation of x.

References

Getis, A. and Ord, J. K. (1992). The analysis of spatial association by use of distance statistics. Geographical Analysis, 24(3), 189-206.

Ord, J. K. and Getis, A. (1995). Local spatial autocorrelation statistics: distributional issues and an application. Geographical Analysis, 27(4), 286-306.

Benjamini, Y. and Hochberg, Y. (1995). Controlling the false discovery rate. Journal of the Royal Statistical Society B, 57(1), 289-300 (step-up rule, Sec. 3).

Python mirror of the verified Gi-star core src/morie/fn/getis.py.

Examples

W <- matrix(0, 5, 5); diag(W) <- 1
W[cbind(1:4, 2:5)] <- 1; W[cbind(2:5, 1:4)] <- 1
Hotcld(c(10, 8, 1, 1, 1), W, alpha = 0.1)
#> $z
#> [1]  1.9744562  1.3163041 -0.5347485 -1.9744562 -1.3163041
#> 
#> $p
#> [1] 0.0483299 0.1880720 0.5928237 0.0483299 0.1880720
#> 
#> $significant
#> [1] FALSE FALSE FALSE FALSE FALSE
#> 
#> $category
#> [1] 0 0 0 0 0
#> 
#> $n_hot
#> [1] 0
#> 
#> $n_cold
#> [1] 0
#> 
#> $alpha
#> [1] 0.1
#> 
#> $n
#> [1] 5
#> 
#> $method
#> [1] "Getis-Ord Gi* hot/cold spots, BH-FDR screened"
#>