amova {pegas} | R Documentation |
This function performs a hierarchical analysis of molecular variance as described in Excoffier et al. (1992). This implementation accepts any number of hierarchical levels.
amova(formula, data = NULL, nperm = 1000) ## S3 method for class 'amova': print(x, ...)
formula |
a formula giving the AMOVA model to be fitted with the
distance matrix on the left-hand side of the ~ , and the
population, region, etc, levels on its right-hand side (see details). |
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. |
x |
an object of class "amova" . |
... |
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 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 the ade4 for an implementation of
the original Excoffier et al.'s model; adonis
for a general (multivariate) implementation of an ANOVA framework with
distances.
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) # 2 levels amova(d ~ p) # 1 level amova(d ~ g) ## 3 levels: 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)