The function partitions the variation in community data or community dissimilarities with respect to two, three, or four explanatory tables, using adjusted R-squared in redundancy analysis ordination (RDA) or distance-based redundancy analysis. If response is a single vector, partitioning is by partial regression. Collinear variables in the explanatory tables do NOT have to be removed prior to partitioning.
1 2 3 4 5 6
Data frame or matrix containing the response data table or
dissimilarity structure inheriting from
Two to four explanatory models, variables or tables. These can
be defined in three alternative ways: (1) one-sided model formulae
Other parameters passed to functions. NB, arguments after dots cannot be abbreviated but they must be spelt out completely.
The data frame with the variables used in the formulae in
Partition Chi-square or the inertia of Correspondence
Should the columns of
Add a constant to the non-diagonal values to euclidify
Take square root of dissimilarities. This often
euclidifies dissimilarities. NB., the argument name cannot be
abbreviated. The argument has an effect only when
Number of explanatory tables (circles) displayed.
Labels used for displayed fractions. Default is to use the same letters as in the printed output.
Fill colours of circles or ellipses.
Transparency of the fill colour. The argument takes precedence over possible transparency definitions of the colour. The value must be in range 0...255, and low values are more transparent. Transparency is not available in all graphics devices or file formats.
Names for sources of variation. Default names are
A numerical value giving the character expansion factor for the names of circles or ellipses.
The values below
The number of significant digits; the number of decimal places is at least one higher.
The functions partition the variation in
Y into components
accounted for by two to four explanatory tables and their combined
Y is a multicolumn data frame or matrix, the
partitioning is based on redundancy analysis (RDA, see
rda) or on constrained correspondence analysis if
chisquare = TRUE (CCA, see
is a single variable, the partitioning is based on linear
Y are dissimilarities, the decomposition is
based on distance-based redundancy analysis (db-RDA, see
capscale) following McArdle & Anderson (2001). The
input dissimilarities must be compatible to the results of
dist. Vegan functions
betadiver produce such objects, as do many other
dissimilarity functions in R packages. However, symmetric square
matrices are not recognized as dissimilarities but must be
as.dist. Partitioning will be made
to squared dissimilarities analogously to using variance with
rectangular data – unless
sqrt.dist = TRUE was specified.
The function primarily uses adjusted R-squared to assess
the partitions explained by the explanatory tables and their
RsquareAdj), because this is the
only unbiased method (Peres-Neto et al., 2006). The raw
R-squared for basic fractions are also displayed, but
these are biased estimates of variation explained by the explanatory
table. In correspondence analysis (
chisquare = TRUE), the
adjusted R-squared are found by permutation and they vary
in repeated analyses.
The identifiable fractions are designated by lower case alphabets. The
meaning of the symbols can be found in the separate document (use
browseVignettes("vegan")), or can be displayed graphically
A fraction is testable if it can be directly expressed as an RDA or
db-RDA model. In these cases the printed output also displays the
corresponding RDA model using notation where explanatory tables
| are conditions (partialled out; see
for details). Although single fractions can be testable, this does
not mean that all fractions simultaneously can be tested, since the
number of testable fractions is higher than the number of estimated
models. The non-testable components are found as differences of
testable components. The testable components have permutation
variance in correspondence analysis (
chisquare = TRUE), and
the non-testable components have even higher variance.
An abridged explanation of the alphabetic symbols for the individual
fractions follows, but computational details should be checked in the
vignette (readable with
browseVignettes("vegan")) or in the
With two explanatory tables, the fractions explained
uniquely by each of the two tables are
[c], and their joint effect
[b] following Borcard et al. (1992).
With three explanatory tables, the fractions explained uniquely
by each of the three tables are
[c], joint fractions between two tables are
[f], and the joint fraction between all three
With four explanatory tables, the fractions explained uniquely by each
of the four tables are
[d], joint fractions between two tables are
[j], joint fractions between three variables are
[n], and the joint fraction between all four tables is
There is a
plot function that displays the Venn diagram and
labels each intersection (individual fraction) with the adjusted R
squared if this is higher than
cutoff. A helper function
showvarpart displays the fraction labels. The circles and
ellipses are labelled by short default names or by names defined by
the user in argument
Xnames. Longer explanatory file names can
be written on the varpart output plot as follows: use option
Xnames=NA, then add new names using the
text function. A
bit of fiddling with coordinates (see
character size should allow users to place names of reasonably short
lengths on the
varpart returns an
object of class
"varpart" with items
transfo (can be missing) which hold information on
tables which contains names of explanatory
call with the function
varpart calls function
varpart4 which return an object of class
"varpart234" and saves its result in the item
The items in this object are:
Sum of squares of matrix
Number of observations (rows).
Number of explanatory tables
Warnings on collinearity.
Basic fractions from all estimated constrained models.
Individual fractions or all possible subsections in
the Venn diagram (see
Fractions that can be found after conditioning on single explanatory table in models with three or four explanatory tables.
Fractions that can be found after conditioning on two explanatory tables in models with four explanatory tables.
contr2 are all data frames with
Df: Degrees of freedom of numerator of the F-statistic
for the fraction.
R.square: Raw R-squared. This is calculated only for
fract and this is
NA in other items.
Adj.R.square: Adjusted R-squared.
Testable: If the fraction can be expressed as a (partial) RDA
model, it is directly
Testable, and this field is
TRUE. In that case the fraction label also gives the
specification of the testable RDA model.
You can use command
browseVignettes("vegan") to display
document which presents Venn diagrams showing the fraction names in
partitioning the variation of Y with respect to 2, 3, and 4 tables of
explanatory variables, as well as the equations used in variation
The functions frequently give negative estimates of variation.
Adjusted R-squared can be negative for any fraction;
unadjusted R-squared of testable fractions of variances
will be non-negative. Non-testable fractions cannot be found
directly, but by subtracting different models, and these subtraction
results can be negative. The fractions are orthogonal, or linearly
independent, but more complicated or nonlinear dependencies can
cause negative non-testable fractions. Any fraction can be negative
for non-Euclidean dissimilarities because the underlying db-RDA model
can yield negative eigenvalues (see
dbrda). These negative eigenvalues in the underlying
analysis can be avoided with arguments
which have a similar effect as in
capscale: the square
roots of several dissimilarities do not have negative eigenvalues, and
no negative eigenvalues are produced after Lingoes or Cailliez
adjustment, which in effect add random variation to the
A simplified, fast version of RDA, CCA adn dbRDA are used (functions
actual calculations are done in functions
varpart4, but these are not intended to be called directly by
Pierre Legendre, Departement de Sciences Biologiques, Universite de Montreal, Canada. Further developed by Jari Oksanen.
(a) References on variation partitioning
Borcard, D., P. Legendre & P. Drapeau. 1992. Partialling out the spatial component of ecological variation. Ecology 73: 1045–1055.
Legendre, P. & L. Legendre. 2012. Numerical ecology, 3rd English edition. Elsevier Science BV, Amsterdam.
(b) Reference on transformations for species data
Legendre, P. and E. D. Gallagher. 2001. Ecologically meaningful transformations for ordination of species data. Oecologia 129: 271–280.
(c) Reference on adjustment of the bimultivariate redundancy statistic
Peres-Neto, P., P. Legendre, S. Dray and D. Borcard. 2006. Variation partitioning of species data matrices: estimation and comparison of fractions. Ecology 87: 2614–2625.
(d) References on partitioning of dissimilarities
Legendre, P. & Anderson, M. J. (1999). Distance-based redundancy analysis: testing multispecies responses in multifactorial ecological experiments. Ecological Monographs 69, 1–24.
McArdle, B.H. & Anderson, M.J. (2001). Fitting multivariate models to community data: a comment on distance-based redundancy analysis. Ecology 82, 290-297.
For analysing testable fractions, see
anova.cca. For data transformation, see
(unadjusted) components of variation for each species or site
rda displays unadjusted
components in its output, but
RsquareAdj will give
adjusted R-squared that are similar to the current
function also for partial models.
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 41
data(mite) data(mite.env) data(mite.pcnm) # Two explanatory data frames -- Hellinger-transform Y mod <- varpart(mite, mite.env, mite.pcnm, transfo="hel") mod ## Use fill colours showvarparts(2, bg = c("hotpink","skyblue")) plot(mod, bg = c("hotpink","skyblue")) ## Test fraction [a] using partial RDA, '~ .' in formula tells to use ## all variables of data mite.env. aFrac <- rda(decostand(mite, "hel"), mite.env, mite.pcnm) anova(aFrac) ## RsquareAdj gives the same result as component [a] of varpart RsquareAdj(aFrac) ## Partition Bray-Curtis dissimilarities varpart(vegdist(mite), mite.env, mite.pcnm) ## Three explanatory tables with formula interface mod <- varpart(mite, ~ SubsDens + WatrCont, ~ Substrate + Shrub + Topo, mite.pcnm, data=mite.env, transfo="hel") mod showvarparts(3, bg=2:4) plot(mod, bg=2:4) ## Use RDA to test fraction [a] ## Matrix can be an argument in formula rda.result <- rda(decostand(mite, "hell") ~ SubsDens + WatrCont + Condition(Substrate + Shrub + Topo) + Condition(as.matrix(mite.pcnm)), data = mite.env) anova(rda.result) ## Four explanatory tables mod <- varpart(mite, ~ SubsDens + WatrCont, ~Substrate + Shrub + Topo, mite.pcnm[,1:11], mite.pcnm[,12:22], data=mite.env, transfo="hel") mod plot(mod, bg=2:5) ## Show values for all partitions by putting 'cutoff' low enough: plot(mod, cutoff = -Inf, cex = 0.7, bg=2:5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.