adonis(formula, data, permutations = 999, method = "bray",
strata = NULL, contr.unordered = "contr.sum",
contr.ordered = "contr.poly", ...)
Y ~ A + B*C
, but
where Y
is either a dissimilarity object (inheriting from
class "dist"
) or data frame or a matrix; A
, B
, and
C
may bA
, B
, and
C
would be drawn.vegdist
to
calculate pairwise distances if the left hand side of the
formula
was a data frame or a matrix.vegdist
.density.adonis
function, or all terms
simultaneously with densityplot.adonis
.model.matrix
for the right hand
side of the formula.terms
component of the model.adonis
is a function for the analysis and partitioning
sums of squares using semimetric and metric distance matrices. Insofar
as it partitions sums of squares of a multivariate data set, it is
directly analogous to MANOVA (multivariate analysis of
variance). M.J. Anderson (McArdle and Anderson 2001, Anderson 2001) refers to the
method as Typical uses of adonis
include analysis of ecological community
data (samples X species matrices) or genetic data where we might have a
limited number of samples of individuals and thousands or millions of
columns of gene expression data (e.g. Zapala and Schork 2006).
adonis
is an alternative to AMOVA (nested analysis of molecular
variance, Excoffier, Smouse, and Quattro, 1992;
amova
in the
If the experimental design has nestedness, then use strata
to
test hypotheses. For instance, imagine we are testing whether a
plant community is influenced by nitrate amendments, and we have two
replicate plots at each of two levels of nitrate (0, 10 ppm). We have
replicated the experiment in three fields with (perhaps) different
average productivity. In this design, we would need to specify
strata = field
so that randomizations occur only within
each field and not across all fields . See example below.
Like AMOVA (Excoffier et al. 1992), adonis
relies on a
long-understood phenomenon that allows one to partition sums of squared
deviations from a centroid in two different ways (McArdle and Anderson
2001). The most widely recognized method, used, e.g., for ANOVA and
MANOVA, is to first identify the relevant centroids and then to
calculated the squared deviations from these points. For a centered
$n \times p$ response matrix $Y$, this method uses the
$p \times p$ inner product matrix $Y'Y$. The less
appreciated method is to use the $n \times n$ outer product
matrix $YY'$. Both AMOVA and adonis
use this latter
method. This allows the use of any semimetric (e.g. Bray-Curtis, aka
Steinhaus, Czekanowski, and
Significance tests are done using $F$-tests based on sequential sums
of squares from permutations of the raw data, and not permutations of
residuals. Permutations of the raw data may have better small sample
characteristics. Further, the precise meaning of hypothesis tests will
depend upon precisely what is permuted. The strata argument keeps groups
intact for a particular hypothesis test where one does not want to
permute the data among particular groups. For instance, strata = B
causes permutations among levels of A
but retains data within
levels of B
(no permutation among levels of B
). See
permutations
for additional details on permutation tests
in Vegan.
The default contrasts
are different than in Rin
general. Specifically, they use contrasts
specified in R, including Helmert and treatment
contrasts.
Rules associated with formulae apply. See "An Introduction to R" for an overview of rules.
print.adonis
shows the aov.tab
component of the output.
Crawley, M.J. 2002. Statistical Computing: An Introduction to Data Analysis Using S-PLUS
Excoffier, L., P.E. Smouse, and J.M. Quattro. 1992. Analysis of molecular variance inferred from metric distances among DNA haplotypes: Application to human mitochondrial DNA restriction data. Genetics, 131:479--491.
Legendre, P. and M.J. Anderson. 1999. Distance-based redundancy analysis: Testing multispecies responses in multifactorial ecological experiments. Ecological Monographs, 69:1--24.
McArdle, B.H. and M.J. Anderson. 2001. Fitting multivariate models to community data: A comment on distance-based redundancy analysis. Ecology, 82: 290--297.
Warton, D.I., Wright, T.W., Wang, Y. 2012. Distance-based multivariate analyses confound location and dispersion effects. Methods in Ecology and Evolution, 3, 89--101.
Zapala, M.A. and N.J. Schork. 2006. Multivariate regression analysis of distance matrices for testing associations between gene expression patterns and related variables. Proceedings of the National Academy of Sciences, USA, 103:19430--19435.
mrpp
, anosim
,
mantel
, varpart
.data(dune)
data(dune.env)
adonis(dune ~ Management*A1, data=dune.env, permutations=99)
### Example of use with strata, for nested (e.g., block) designs.
dat <- expand.grid(rep=gl(2,1), NO3=factor(c(0,10)),field=gl(3,1) )
dat
Agropyron <- with(dat, as.numeric(field) + as.numeric(NO3)+2) +rnorm(12)/2
Schizachyrium <- with(dat, as.numeric(field) - as.numeric(NO3)+2) +rnorm(12)/2
total <- Agropyron + Schizachyrium
dotplot(total ~ NO3, dat, jitter.x=TRUE, groups=field,
type=c('p','a'), xlab="NO3", auto.key=list(columns=3, lines=TRUE) )
Y <- data.frame(Agropyron, Schizachyrium)
mod <- metaMDS(Y)
plot(mod)
### Hulls show treatment
ordihull(mod, group=dat$NO3, show="0")
ordihull(mod, group=dat$NO3, show="10", col=3)
### Spider shows fields
ordispider(mod, group=dat$field, lty=3, col="red")
### Correct hypothesis test (with strata)
adonis(Y ~ NO3, data=dat, strata=dat$field, perm=999)
### Incorrect (no strata)
adonis(Y ~ NO3, data=dat, perm=999)
Run the code above in your browser using DataLab