| IrregularMoransI | R Documentation |
Calculate Moran's I between two groups with irregular data shape.
IrregularMoransI(
X,
W,
group1,
group2,
OLS = FALSE,
normalize = 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. |
group1 |
The indices or names for the first group of observations. |
group2 |
The indices or names for the second group of observations. |
OLS |
Whether to use |
normalize |
Whether to normalize the weight matrix such that each row adds up to one. Default is |
alternative |
Alternative hypothesis used, default is |
p.adjust.method |
Method used for multiple comparisons correction, default is |
A list containing the output from BivariateMoransI or OLSMoransI.
{
data.use <- quakes[1:100,]
W <- 1/as.matrix(dist(data.use[,1:2]))
diag(W) <- 0
res <- IrregularMoransI(data.use[,3:4], W, 1:10, 21:30)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.