powered by
Calculate local Getis-Ord Gi or Gi* statistics.
LocalGi( X, W, gstar = TRUE, alternative = c("two.sided", "less", "greater"), p.adjust.method = "BH" )
A matrix with observations as rows and features as columns.
A weight matrix across all observations, i.e inverse of a pairwise distance matrix.
Whether to calculate the Gi* statistics, default is TRUE.
TRUE
Alternative hypothesis used, default is two.sided.
two.sided
Method used for multiple comparisons correction, default is BH. See p.adjust.
BH
p.adjust
A list containing the following:
Gi, Gi or Gi* statistics.
p.val, permutation based p-value.
p.adj, adjusted p-values.
gstar, permutation used if returned.
alternative, alternative hypothesis used.
p.adjust.method, method used for multiple comparisons correction.
Getis, A. & Ord, J. K. The analysis of spatial association by use of distance statistics. Geogr. Anal. 24, 189<U+2013>206 (1992)
# NOT RUN { { data.use <- quakes[1:100,] W <- 1/as.matrix(dist(data.use[,1:2])) diag(W) <- 0 res <- LocalGi(data.use[,3:4], W) } # }
Run the code above in your browser using DataLab