PERMANOVA effect sizes

In the typical output of PERMANOVA you get R2 values (also called Eta-squared). These can be interpreted as variance explained. They are calculated from the Sum of Squares for the variables. However, these values can be biased, especially with small sample sizes, and they are not always comparable between variables with different degrees of freedom, as more degrees of freedom give higher Sum of Squares and therefore higher R2 values.

In this notebook we will see how to calculate (partial) Omega-squared values, which are unbiased estimators of effect sizes. The Omega-squared values can be interpreted as the Eta-squared (R2).

The "partial" in partial Omega-squared is optional, and is a way to account for the effects sizes for other variables in the models. It has no effect on models with 1 variable, but is recommended for models with more than 1 variable. It is akin to adjusted R2 in a linear model, in that there is a penalty for each added degree of freedom.

In [1]:
# Load data and packages
library(phyloseq)
library(vegan)
library(MicEco)
load("../data/physeq.RData")
Indlæser krævet pakke: permute

Indlæser krævet pakke: lattice

This is vegan 2.5-7

In [2]:
# Run UniFrac
UF <- UniFrac(phy)
In [3]:
# Run PERMANOVA
Samp <- data.frame(sample_data(phy))
per <- adonis(UF ~ Time + Patient, data = Samp)
In [4]:
# Standard summary
per
Call:
adonis(formula = UF ~ Time + Patient, data = Samp) 

Permutation: free
Number of permutations: 999

Terms added sequentially (first to last)

           Df SumsOfSqs MeanSqs F.Model      R2 Pr(>F)    
Time        2     7.154  3.5770 21.3262 0.22406  0.001 ***
Patient    49     8.337  0.1701  1.0144 0.26111  0.389    
Residuals  98    16.437  0.1677         0.51482           
Total     149    31.929                 1.00000           
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The Time variable explains around 22% and is highly significant. However, the Patient variable explains 26%, but is not significant.

In [5]:
# Add partial Omega-squared values
adonis_OmegaSq(per, partial = TRUE)
Call:
adonis(formula = UF ~ Time + Patient, data = Samp) 

Permutation: free
Number of permutations: 999

Terms added sequentially (first to last)

           Df SumsOfSqs MeanSqs F.Model      R2 parOmegaSq Pr(>F)    
Time        2     7.154  3.5770 21.3262 0.22406   0.213228  0.001 ***
Patient    49     8.337  0.1701  1.0144 0.26111   0.004679  0.389    
Residuals  98    16.437  0.1677         0.51482                      
Total     149    31.929                 1.00000                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

With the Omega-squared values we see that the Patient effect is actually tiny, and it was inflated due to the many degrees of freedom.