eco.mantel: Mantel and partial Mantel tests, with truncation option

Description Usage Arguments Value Author(s) References Examples

Description

Mantel test or Partial Mantel test for distance matrices d1 and d2, or partial Mantel test for d1 and d2, conditioned on the matrix dc. The test can be performed for truncated distances (Legendre et al. 2015) or for a particular direction (Falsetti and Sokal, 1993) using a weights object generated with eco.bearing.

Usage

1
2
3
4
eco.mantel(d1, d2, dc = NULL, con = NULL, thres = NULL,
  truncMat = c("d2", "d1", "dc"), method = c("pearson", "spearman",
  "kendall"), nsim = 99, alternative = c("auto", "two.sided", "less",
  "greater"), plotit = TRUE, ...)

Arguments

d1

Distance matrix.

d2

Distance matrix.

dc

Distance matrix (optional).

con

Binary eco.weight object used for truncation, or a weights object obtained with eco.bearing.

thres

Threshold distance used for truncation. Distances above the threshold are set as 4 times the threshold. If thres is null, and con is not null, the parameter set to the maximum distance observed in d2.

truncMat

Matrix used for truncation (default = d2)

method

Correlation method used for the construction of the statistic ("pearson", "spearman" or "kendall"). Kendall's tau computation is slow.

nsim

Number of Monte-Carlo simulations.

alternative

The alternative hypothesis. If "auto" is selected (default) the program determines the alternative hypothesis. Other options are: "two.sided", "greater" and "less".

plotit

Plot a histogram of the simulations?

...

Additional arguments passed to cor.

Value

An object of class "eco.gsa" with the following slots:

> METHOD method used in the analysis

> OBS observed value

> EXP expect value

> PVAL P-value

> ALTER alternative hypotesis

> NSIM number of simulations

ACCESS TO THE SLOTS The content of the slots can be accessed with the corresponding accessors, using the generic notation of EcoGenetics (<ecoslot.> + <name of the slot> + <name of the object>). See help("EcoGenetics accessors") and the Examples section below

Author(s)

Leandro Roser [email protected]

References

Falsetti A., and Sokal R. 1993. Genetic structure of human populations in the British Isles. Annals of Human Biology 20: 215-229.

Legendre P. 2000. Comparison of permutation methods for the partial correlation and partial Mantel tests. Journal of Statistical Computation and Simulation, 67: 37-73.

Legendre P., and M. Fortin. 2010. Comparison of the Mantel test and alternative approaches for detecting complex multivariate relationships in the spatial analysis of genetic data. Molecular Ecology Resources, 10: 831-844.

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

Smouse P. Long and R. Sokal. 1986. Multiple regression and correlation extensions of the Mantel test of matrix correspondence. Systematic zoology, 627-632.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Not run: 

data(eco.test)

### Ordinary Mantel test ###
eco.mantel(d1 = dist(eco[["P"]]), d2 = dist(eco[["E"]]), nsim = 99)  

### Partial Mantel test ###
pm <- eco.mantel(d1 = dist(eco[["P"]]), d2 = dist(eco[["E"]]), 
dc = dist(eco[["XY"]]), nsim = 99)                               

### Truncated Mantel test ###
# checking threshold in a correlogram:
corm <- eco.cormantel(M = dist(eco[["P"]]), XY = eco[["XY"]], nsim = 99)
eco.plotCorrelog(corm)
# Correlation is around 0 when distance between points is > 5

# creating a weights object for truncation
con <- eco.weight(eco@XY, method="circle", d2=5)
# compute a truncated mantel test
eco.mantel(dist(eco[["P"]]), dist(eco[["XY"]]), con=con)

### Directional Mantel test ###
# analyzing with a Mantel test, in a direction of 35 degrees counterclockwise from E.
con2 <- eco.bearing(XY = eco[["XY"]], theta = 37)
eco.mantel(dist(eco[["P"]]), dist(eco[["XY"]]), con = con2)

#-----------------------
# ACCESSORS USE EXAMPLE
#-----------------------

# the slots are accessed with the generic format 
# (ecoslot. + name of the slot + name of the object). 
# See help("EcoGenetics accessors")

ecoslot.OBS(pm)     # slot OBS (observed value)
ecoslot.PVAL(pm)    # slot PVAL (P-value) 


## End(Not run)

EcoGenetics documentation built on Jan. 14, 2018, 9:04 a.m.