R: Permutational multivariate analysis of variance using...
PermanovaG
R Documentation
Permutational multivariate analysis of variance using multiple distance
matrices
Description
In practice, we do not know a priori which type of change happens in
the microbiome. Each distance measure is most powerful in detecting
only a certain scenario. When multiple distance matrices are available,
separate tests using each distance matrix will lead to loss of power
due to multiple testing correction. Combing the distance matrices
in a single test will improve power. PermanovaG combines multiple distance
matrices by taking the maximum of pseudo-F statistics for each distance
matrix. Significance is assessed by permutation.
Usage
PermanovaG(formula, dat = NULL, ...)
Arguments
formula
Left side of the formula (Y ~ X) is a three dimensional ARRAY
containing the supplied distance matrices as produced by GUniFrac
function.
Jun Chen and Hongzhe Li(2012). Associating microbiome composition with
environmental covariates using generalized UniFrac distances. (Submitted)
See Also
Rarefy, GUniFrac
Examples
data(throat.otu.tab)
data(throat.tree)
data(throat.meta)
groups <- throat.meta$SmokingStatus
# Rarefaction
otu.tab.rff <- Rarefy(throat.otu.tab)$otu.tab.rff
# Calculate the UniFracs
unifracs <- GUniFrac(otu.tab.rff, throat.tree, alpha=c(0, 0.5, 1))$unifracs
# Combine unweighted and weighted UniFrac for testing
PermanovaG(unifracs[, , c("d_1", "d_UW")] ~ groups)
# Combine d(0), d(0.5), d(1) for testing
PermanovaG(unifracs[, , c("d_0", "d_0.5", "d_1")] ~ groups)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(GUniFrac)
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.4-0
Loading required package: ape
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GUniFrac/PermanovaG.Rd_%03d_medium.png", width=480, height=480)
> ### Name: PermanovaG
> ### Title: Permutational multivariate analysis of variance using multiple
> ### distance matrices
> ### Aliases: PermanovaG
> ### Keywords: htest distance multivariate nonparametric regression
>
> ### ** Examples
>
> data(throat.otu.tab)
> data(throat.tree)
> data(throat.meta)
>
> groups <- throat.meta$SmokingStatus
>
> # Rarefaction
> otu.tab.rff <- Rarefy(throat.otu.tab)$otu.tab.rff
>
> # Calculate the UniFracs
> unifracs <- GUniFrac(otu.tab.rff, throat.tree, alpha=c(0, 0.5, 1))$unifracs
>
> # Combine unweighted and weighted UniFrac for testing
> PermanovaG(unifracs[, , c("d_1", "d_UW")] ~ groups)
$aov.tab
F.Model p.value
groups 3.019045 0.008
> # Combine d(0), d(0.5), d(1) for testing
> PermanovaG(unifracs[, , c("d_0", "d_0.5", "d_1")] ~ groups)
$aov.tab
F.Model p.value
groups 3.019045 0.009
>
>
>
>
>
> dev.off()
null device
1
>