Package 'mpmcorrelogram'

Title: Multivariate Partial Mantel Correlogram
Description: Functions to compute and plot multivariate (partial) Mantel correlograms.
Authors: Marcelino de la Cruz
Maintainer: Marcelino de la Cruz <[email protected]>
License: GPL (>= 2)
Version: 0.1-4
Built: 2024-12-05 06:51:14 UTC
Source: CRAN

Help Index


Assemblage similarity and geographic distance matrices

Description

Artificial data matrices used by Legendre and Legendre (1998) to exemplify the computation of multivariate Mantel correlograms. S is assumed to represent a similarity matrix computed from assemblage data among 10 sampling sites within a 1-km2 sampling area (Legendre and Legendre 1998: 737). D is the matrix of euclidean distances among the sampling localities (Legendre and Legendre 1998: 718). Zd is another distance matrix, assumed to represent some other multivariate difference among sites (e.g. environmental diferences) that are more accentuated for distances greater than 0.28 km.

Usage

data(S)
  data(D)
  data(Zd)

References

Legendre, P. and Legendre, L. (1998) Numerical Ecology. 2nd English Edition. Elsevier

Examples

data(S)
data(Zd)

Multivariate Partial Mantel Correlogram

Description

Function mpmcorrelogram computes both multivariate and multivariate partial Mantel correlograms. Multivariate Mantel correlograms were proposed by Sokal (1986) and Oden and Sokal (1986) and popularized among ecologists by Legendre and Legendre (1998, pp. 736-738). Multivariate partial Mantel correlograms are described and employed by Matesanz et al. (2011).

Usage

mpmcorrelogram(xdis, geodis, zdis = NULL, method = "pearson",
                 alfa = 0.05, nclass = NULL, breaks = NULL,
                 permutations = 999, strata, simil = FALSE,
                 plot = TRUE, print = TRUE)

  ## S3 method for class 'mpmcorrelogram'
plot(x, pch = c(15, 22), xlim = NULL, ylim = NULL,
                ylab = NULL, xlab = NULL, alfa = 0.05, ...)

Arguments

xdis, geodis, zdis

Multivariate distance (or similarity) matrices or their as.dist representation

method

Correlation method, as accepted by cor: "pearson", "spearman" or "kendall".

alfa

Significance level for the points drawn with black symbols in the correlogram. By default alpha = 0.05.

nclass

Number of distance classes. Deafult NULL causes Sturge's law being used to determine the number of classes unless break points are provided.

breaks

Vector with break points of the distance classes.

permutations

Number of permutations for the tests of significance.

strata

An integer vector or factor specifying the strata for permutation. If supplied, observations are permuted only within the specified strata.

simil

Logical. Is the first matrix a similarity matrix? Default=FALSE.

plot

Logical. Should the correlogram be ploted?.

print

Logical. Should the results be printed?

x

An object of class mpmcorrelogram, i.e. resulting from function mpmcorrelogram.

pch

Vector with two integers (or two single characters) specifying the symbols (or characters) to plot respectively the significant and non-significant rM values. See points for possible values and their interpretation.

xlim

Vector with the limits for the x-axis.

ylim

Vector with the limits for the y-axis.

ylab

Label for the y-axis.

xlab

Label for the x-axis.

...

Other parameters passed to print and plot methods.

Details

The function mpmcorrelogram computes both Mantel correlograms and partial Mantel correlograms. A correlogram is a graph in which spatial correlation values are plotted, on the ordinate, as a function of the geographic distance classes among the study units along the abscissa. In a "classical" Mantel correlogram, a Mantel correlation (Mantel 1967) is computed between a multivariate (e.g. multi-species or multi-locus) distance or similarity matrix and a design matrix representing each of the geographic distance classes in turn. The Mantel statistic is tested through a permutational Mantel test performed by vegan's mantel function.

In a partial Mantel correlogram, a partial correlation conditioned on a third matrix is computed between the focal matrix and the design matrix representing each of the geographic distance classes. In this case, the partial Mantel statistic is tested through a permutational test performed by vegan's mantel.partial function.

A practical application of the use of the partial Mantel correlogram can be seen in Matesanz et al. (2011).

Value

If the arguments plot and print are both TRUE, mpmcorrelogram by default will draw a correlogram where solid squares indicate significant rM values and void squares indicate non-significant ones. It will also print the results as a table. In any case, mpmcorrelogram will return an object of class mpmcorrelogram, i.e. a list with the following elements:

breaks

Vector with the break points of the distance classes considered.

rM

Vector with the computed Mantel correlations for each distance class.

signif

The value of the selected alfa.

pvalues

Vector with the p-values computed for each distance class.

pval.Bonferroni

Vector with the p-values after a progressive Bonferroni correction.

clases

Alfanumeric vector with the range of each distance class.

Acknowledgements

This package has been developed thaks to the subvention 099/RN08/02.1 of the Spanish Ministerio de Medio Ambiente, Medio Rural y Marino.

Note

The implementation of the Mantel correlogram computation in the function mpmcorrelogram (and that of Mantel correlation performed by vegan's mantel.partial and mantel functions) are based on the description of Legendre and Legendre (1998). Following these approaches, positive Mantel statistics correspond to positive autocorrelation when the focal matrix (i.e. xdis) is a similarity matrix and to negative values when it is a distance matrix. As most of the designed tools in R for summarizing relationships between the rows of data matrices return distance objects, the argument simil in mpmcorrelogram is set by default to FALSE. See the examples for the use with a similarity matrix.

Author(s)

Marcelino de la Cruz Rot [email protected]

References

Legendre, P. and L. Legendre. 1998. Numerical ecology, 2nd English edition. Elsevier Science BV, Amsterdam.

Mantel, N. 1967. The detection of disease clustering and a generalized regression approach. Cancer Res. 27: 209-220.

Matesanz S., Gimeno T.E., de la Cruz M., Escudero A. and Valladares F. 2011. Competition may explain the fine-scale spatial patterns and genetic structure of two co-occurring plant congeners. J. Ecol. 99: 838-848

Oden, N. L. and R. R. Sokal. 1986. Directional autocorrelation: an extension of spatial correlograms to two dimensions. Syst. Zool. 35: 608-617.

Sokal, R. R. 1986. Spatial data analysis and historical processes. 29-43 in: E. Diday et al. (eds.) Data analysis and informatics, IV. North-Holland, Amsterdam.

See Also

vegan's mantel.correlog for another implementation of (non-partial) Mantel correlograms.

Examples

# Example from Figure 13.12 of Legendre and Legendre (1998):

 # Get similarity matrix based on assemblage composition.
 
 data(S) 
 
 # Get euclidean distance between sites.
 
 data(D)
 
 # Compute Multivariate Mantel Correlogram
 # as in Fig. 13.12 of Legendre and Legendre
 
 ## Not run: 
 result <- mpmcorrelogram(S, D, simil=TRUE)
 
## End(Not run)
 
 
 # A Multivariate Partial examle.
 # Get distance matrix of "covariate" attributes
 
 data(Zd)
 
 # Compute multivariate partial Mantel correlogram
 
 ## Not run: 
 result <- mpmcorrelogram(S, D, Zd, simil=TRUE)
 
## End(Not run)
 

# Change the appearance of the plot
 
 ## Not run: 
 plot(result, pch=c(17,24))
 
## End(Not run)