mantel.correlog function

Mantel (cross-)correlograms

Mantel (cross-)correlograms

mantel.correlog is the function to calculate a Mantel (cross-)correlogram. The function requires two (or three) matrices.

mantel.correlog( dmat, zmat, wmat = NULL, increment, resamp = 999, quiet = FALSE )

Arguments

  • dmat: a matrix representing distance.
  • zmat: a matrix representing similarity.
  • wmat: an optional third matrix of similarities to calculate a Mantel cross-correlograms.
  • increment: increment for the uniformly distributed distance classes.
  • resamp: the number of permutations under the null to assess level of significance.
  • quiet: If TRUE, the counter is suppressed during execution.

Returns

An object of class "correlog" is returned, consisting of the following components: - correlation: the value for the Moran (or Mantel) similarity.

  • mean.of.class: the actual average of the distances within each distance class.

  • nlok: the number of pairs within each distance class.

  • x.intercept: the interpolate x.intercept of Epperson (1993).

  • p: the permutation two-sided p-value for each distance-class.

  • corr0: If a cross-correlogram is calculated, corr0 gives the empirical cross-correlation at distance zero.

Details

The function calculates Mantel (cross-)correlograms at discrete distance classes from two (or three) matrixes. The first is the matrix of distances and the second is a matrix of similarities. The optional third matrix is an additional similarity matrix to be used to calculate a Mantel cross-correlogram. Missing values are allowed -- values are assumed missing at random.

Examples

# first generate some sample data x <- expand.grid(1:20, 1:5)[, 1] y <- expand.grid(1:20, 1:5)[, 2] # z data from an exponential random field z <- cbind( rmvn.spa(x = x, y = y, p = 2, method = "exp"), rmvn.spa(x = x, y = y, p = 2, method = "exp") ) # w data from a gaussian random field w <- cbind(rmvn.spa( x = x, y = y, p = 2, method = "gaus"), rmvn.spa(x = x, y = y, p = 2, method = "gaus") ) # Make distance and similarity matrices zmat <- cor(t(z)) wmat <- cor(t(w)) dmat <- sqrt(outer(x, x, "-")^2 + outer(y, y, "-")^2) # Mantel correlogram fit1 <- mantel.correlog(dmat = dmat, zmat = zmat, increment = 2, quiet = TRUE, resamp = 0) ## Not run: plot(fit1) # Mantel cross-correlogram fit2 <- mantel.correlog(dmat = dmat, zmat = zmat, wmat = wmat, increment = 2, quiet = TRUE, resamp = 0) ## Not run: plot(fit2)

See Also

plot.correlog

Author(s)

Ottar N. Bjornstad onb1@psu.edu

  • Maintainer: Ottar N. Bjornstad
  • License: GPL-3
  • Last published: 2022-05-07