mantelTest {biotools} | R Documentation |
Mantel's Permutation Test
Description
Mantel's permutation test based on Pearson's correlation coefficient to evaluate the association between two distance square matrices.
Usage
mantelTest(m1, m2, nperm = 999, alternative = "greater",
graph = TRUE, main = "Mantel's test", xlab = "Correlation", ...)
Arguments
m1 |
an object of class "matrix" or "dist", containing distances among n individuals. |
m2 |
an object of class "matrix" or "dist", containing distances among n individuals. |
nperm |
the number of matrix permutations. |
alternative |
a character specifying the alternative hypothesis. It must be one of "greater" (default), "two.sided" or "less". |
graph |
logical; if TRUE (default), the empirical distribution is plotted. |
main |
opitional; a character describing the title of the graphic. |
xlab |
opitional; a character describing the x-axis label. |
... |
further graphical arguments. See |
Value
A list of
correlation |
numeric; the observed Pearson's correlation between |
p.value |
numeric; the empirical p-value of the permutation test. |
alternative |
character; the alternative hypothesis used to compute |
nullcor |
numeric vector containing randomized values of correlation, i.e., under the null hypothesis that the true correlation is equal to zero. |
Author(s)
Anderson Rodrigo da Silva <anderson.agro@hotmail.com>
References
Mantel, N. (1967). The detection of disease clustering and a generalized regression approach. Cancer Research, 27:209–220.
See Also
Examples
# Distances between garlic cultivars
data(garlicdist)
garlicdist
# Tocher's clustering
garlic <- tocher(garlicdist)
garlic
# Cophenetic distances
coph <- cophenetic(garlic)
coph
# Mantel's test
mantelTest(garlicdist, coph,
xlim = c(-1, 1))
# End (Not run)