| PermutationGi | R Documentation |
Calculate permutation based p-value for Getis-Ord Gi or Gi* statistics.
PermutationGi(
x,
W,
gstar = TRUE,
n = 999,
seed = 1,
alternative = c("two.sided", "less", "greater"),
p.adjust.method = "BH",
return.permutation = FALSE,
condition = 0
)
x |
A numerical vector. |
W |
A weight matrix across all observations, i.e inverse of a pairwise distance matrix. |
gstar |
Whether to calculate the Gi* statistics, default is |
n |
The number of permutations to be conducted, set to 999 by default. |
seed |
Random seed used. Default is 1. |
alternative |
Alternative hypothesis used, default is |
p.adjust.method |
Method used for multiple comparisons correction, default is |
return.permutation |
Return permutations. Default is |
condition |
Value under null hypothesis to compare with, default is 0. |
A list containing the following:
Gi, Gi or Gi* statistics.
p.val, permutation based p-value.
p.adj, adjusted p-values.
return.permutation, permutation used if returned.
params, parameters used to calculate local Moran's I.
{
data.use <- quakes[1:100,]
W <- 1/as.matrix(dist(data.use[,1:2]))
diag(W) <- 0
res <- PermutationGi(data.use[,3], W)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.