betadisper {vegan} | R Documentation |
Implements Marti Anderson's PERMDISP2 procedure for the analysis of
multivariate homogeneity of group dispersions (variances).
betadisper
is a multivariate analogue of Levene's test for
homogeneity of variances. Non-euclidean distances between objects and
group centroids are handled by reducing the original distances to
principal coordinates. This procedure has latterly been used as a
means of assessing beta diversity.
betadisper(d, group, type = c("centroid", "median")) ## S3 method for class 'betadisper': anova(object, ...) permDisper(object, control = permControl(nperm = 999)) ## S3 method for class 'betadisper': scores(x, display = c("sites", "centroids"), choices = c(1,2), ...) ## S3 method for class 'betadisper': plot(x, axes = c(1,2), cex = 0.7, hull = TRUE, ylab, xlab, main, sub, ...) ## S3 method for class 'betadisper': boxplot(x, ylab = "Distance to centroid", ...)
d |
a distance structure such as that returned by
dist or vegdist . |
group |
vector describing the group structure, usually a factor
or an object that can be coerced to a factor using
as.factor . |
type |
the type of analysis to perform. Only type =
"centroid" is currently supported. |
object, x |
an object of class "betadisper" , the result of a
call to betadisper . |
control |
a list of control values for the permutations
to replace the default values returned by the function
permControl . |
display |
character; partial match to access scores for
"sites" or "species" . |
choices, axes |
the principal coordinate axes wanted. |
hull |
logical; should the convex hull for each group be plotted? |
cex, ylab, xlab, main, sub |
graphical parameters. For details,
see plot.default . |
... |
arguments, including graphical parameters, passed to other methods. |
One measure of multivariate dispersion (variance) for a group of samples is to calculate the average distance of group members to the group centroid or spatial median in multivariate space. To test if the dispersions (variances) of one or more groups are different, the distances of group members to the group centroid are subject to ANOVA. This is a multivariate analogue of Levene's test for homogeneity of variances if the distances between group members and group centroids is the Euclidean distance.
However, better measures of distance than the Euclidean distance are available for ecological data. These can be accommodated by reducing the distances produced using any dissimilarity coefficient to principal coordinates, which embeds them within a Euclidean space. The analysis then proceeds by calculating the Euclidean distances between group members and the group centroid on the basis of the principal coordinate axes rather than the original distances.
Non-metric dissimilarity coefficients can produce principal coordinate axes that have negative Eigenvalues. These correspond to the imaginary, non-metric part of the distance between objects. If negative Eigenvalues are produced, we must correct for these imaginary distances.
To test if one or more groups is more variable than the others, ANOVA
of the distances to group centroids can be performed and parametric
theory used to interpret the significance of F. An alternative is to
use a permutation test. permDisper
permutes model residuals to
generate a permutation distribution of F under the Null hypothesis of
no difference in dispersion between groups.
The results of the analysis can be visualised using the plot
and boxplot
methods.
One additional use of these functions is in assessing beta diversity (Anderson et al 2006).
The anova
method returns an object of class "anova"
inheriting from class "data.frame"
.
permDisper
returns an object of class "permDisper"
, a list
with components tab
, the ANOVA table which is an object
inheriting from class "data.frame"
, and control
, the
result of a call to permControl
..
The scores
method returns a list with one or both of the
components "sites"
and "centroids"
.
The plot
function invisibly returns an object of class
"ordiplot"
, a plotting structure which can be used by
identify.ordiplot
(to identify the points) or other
functions in the ordiplot
family.
The boxplot
function invisibly returns a list whose components
are documented in boxplot
.
betadisper
returns a list of class "betadisper"
with the
following components:
eig |
numeric; the eigenvalues of the principal coordinates analysis. |
vectors |
matrix; the eigenvectors of the principal coordinates analysis. |
distances |
numeric; the Euclidean distances in principal coordinate space between the samples and their respective group centroid. |
group |
factor; vector describing the group structure |
centroids |
matrix; the locations of the group centroids on the principal coordinates. |
call |
the matched function call. |
Gavin L. Simpson
Anderson, M.J. (2006) Distance-based tests for homogeneity of multivariate dispersions. Biometrics 62(1), 245–253.
Anderson, M.J., Ellingsen, K.E. & McArdle, B.H. (2006) Multivariate dispersion as a measure of beta diversity. Ecology Letters 9(6), 683–693.
data(varespec) ## Bray-Curtis distances between samples dis <- vegdist(varespec) ## First 16 sites grazed, remaining 8 sites ungrazed groups <- factor(c(rep(1,16), rep(2,8)), labels = c("grazed","ungrazed")) ## Calculate multivariate dispersions mod <- betadisper(dis, groups) mod ## Perform test anova(mod) ## Permutation test for F permDisper(mod) ## Plot the groups and distances to centroids on the ## first two PCoA axes plot(mod) ## Draw a boxplot of the distances to centroid for each group boxplot(mod)