Calculate bivariate (multivariate) Moran's I using Wartenberg's method.

BivariateMoransI(
  X,
  W,
  alternative = c("two.sided", "less", "greater"),
  p.adjust.method = "BH"
)

Arguments

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.

alternative

Alternative hypothesis used, default is two.sided.

p.adjust.method

Method used for multiple comparisons correction, default is BH. See p.adjust.

Value

A list containing the following:

  • Morans.I, the Moran's I.

  • Z.I, the Z score of Moran's I.

  • Expected.I, the expectation of Moran's I under the null hypothesis.

  • SD.I, the standard deviation of Moran's I under the null hypothesis.

  • alternative, alternative hypothesis used.

  • p.adjust.method, method used for multiple comparisons correction.

References

Wartenberg, D. Multivariate spatial correlation: A method for exploratory geographical analysis. Geogr. Anal. 17, 263–283 (1985)

Czaplewski, R. L. Expected Value and Variance of Moran’s Bivariate Spatial Autocorrelation Statistic for a Permutation Test. (U.S. Department of Agriculture, Forest Service, Rocky Mountain Forest and Range Experiment Station, 1993).

Examples

{
data.use <- quakes[1:100,]
W <- 1/as.matrix(dist(data.use[,1:2]))
diag(W) <- 0
res <- BivariateMoransI(data.use[,3:4], W)
}