mantelTest: Mantel's Permutation Test

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/mantelTest.R

Description

Mantel's permutation test based on Pearson's correlation coefficient to evaluate the association between two distance square matrices.

Usage

1
2
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 par.

Value

A list of

correlation

numeric; the observed Pearson's correlation between m1 and m2.

p.value

numeric; the empirical p-value of the permutation test.

alternative

character; the alternative hypothesis used to compute p.value.

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

mantelPower

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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)

biotools documentation built on Aug. 7, 2021, 9:06 a.m.