Description Usage Arguments Details Value Note Author(s) References See Also Examples
This function performs a hierarchical analysis of molecular variance as described in Excoffier et al. (1992). This implementation accepts any number of hierarchical levels.
1 2 3 |
formula |
a formula giving the AMOVA model to be fitted with the
distance matrix on the left-hand side of the |
data |
an optional data frame where to find the hierarchical levels; by default they are searched for in the user's workspace. |
nperm |
the number of permutations for the tests of hypotheses (1000 by default). Set this argument to 0 to skip the tests and simply estimate the variance components. |
is.squared |
a logical specifying whether the distance matrix has already been squared. |
x |
an object of class |
... |
unused (here for compatibility. |
The formula must be of the form d ~ A/B/...
where d
is a
distance object, and A
, B
, etc, are the hierarchical
levels from the highest to the lowest one. Any number of levels is
accepted, so specifying d ~ A
will simply test for population
differentiation.
It is assumed that the rows of the distance matrix are in the same order than the hierarchical levels (which may be checked by the user).
An object of class "amova"
which is a list with a table of sums
of square deviations (SSD), mean square deviations (MSD), and the
number of degrees of freedom, and a vector of variance components.
If there are more than three levels, approximate formulae are used to estimate the variance components.
Emmanuel Paradis
Excoffier, L., Smouse, P. E. and Quattro, J. M. (1992) Analysis of molecular variance inferred from metric distances among DNA haplotypes: application to human mitochondrial DNA restriction data. Genetics, 131, 479–491.
amova
in ade4 for an implementation of
the original Excoffier et al.'s model; adonis
in
vegan for a general (multivariate) implementation of an ANOVA
framework with distances.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ### All examples below have 'nperm = 100' for faster execution times.
### The default 'nperm = 1000' is recommended.
require(ape)
data(woodmouse)
d <- dist.dna(woodmouse)
g <- factor(c(rep("A", 7), rep("B", 8)))
p <- factor(c(rep(1, 3), rep(2, 4), rep(3, 4), rep(4, 4)))
amova(d ~ g/p, nperm = 100) # 2 levels
amova(d ~ p, nperm = 100) # 1 level
amova(d ~ g, nperm = 100)
## 3 levels (quite slow):
## Not run:
pop <- gl(64, 5, labels = paste("pop", 1:64))
region <- gl(16, 20, labels = paste("region", 1:16))
conti <- gl(4, 80, labels = paste("conti", 1:4))
dd <- as.dist(matrix(runif(320^2), 320))
amova(dd ~ conti/region/pop, nperm = 100)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.