R/gv_betadisper.R
run_betadisper.Rd
The run_betadisper
function is a multivariate analogue of Levene's test
for homogeneity of variances.
(Required). a phyloseq::phyloseq
or
SummarizedExperiment::SummarizedExperiment
object.
(Optional). character. Summarization
level (from rank_names(pseq)
, default: NULL).
(Required). character. grouping variable for test.
(Optional). character. the type of analysis to perform. Use the spatial "median" or the group "centroid" (default: "median").
(Optional). character. Provide one of the currently supported
options. See distanceMethodList
for a detailed list of the supported options
and links to accompanying documentation. Options include:
"bray": bray crutis distance.
"unifrac" : unweighted UniFrac distance.
"wunifrac": weighted-UniFrac distance.
"GUniFrac": The variance-adjusted weighted UniFrac distances (default: alpha=0.5).
"dpcoa": sample-wise distance used in Double Principle Coordinate Analysis.
"jsd": Jensen-Shannon Divergence.
Alternatively, you can provide a character string that defines a custom
distance method, if it has the form described in designdist
(default: "bray").
(Optional). numeric. specify seeds for reproduction (default: 123).
(Optional). numeric. the parameter for "GUniFrac" controlling weight on abundant lineages (default: 0.5).
A betadisper model.
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 (both referred to as 'centroid' from now on unless stated
otherwise) 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.
See ?vegan::betadisper
for more details. It can be applied to both
phyloseq::phyloseq
and SummarizedExperiment::SummarizedExperiment
object.
Anderson, Marti J., Kari E. Ellingsen, and Brian H. McArdle. "Multivariate dispersion as a measure of beta diversity." Ecology letters 9.6 (2006): 683-693.