| LocalGi | R Documentation |
Calculate local Getis-Ord Gi or Gi* statistics.
LocalGi(
X,
W,
gstar = TRUE,
alternative = c("two.sided", "less", "greater"),
p.adjust.method = "BH"
)
X |
A matrix with observations as rows and features as columns. |
W |
A weight matrix across all observations, i.e inverse of a pairwise distance matrix. |
gstar |
Whether to calculate the Gi* statistics, default is |
alternative |
Alternative hypothesis used, default is |
p.adjust.method |
Method used for multiple comparisons correction, default is |
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–206 (1992)
{
data.use <- quakes[1:100,]
W <- 1/as.matrix(dist(data.use[,1:2]))
diag(W) <- 0
res <- LocalGi(data.use[,3:4], W)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.