4 Population-wise multivariate ANOVA

# Fit the MANOVA model
manova_model <- manova(cbind(count, rel_abund) ~ nationality + bmi, data = ps_df)

# Print the summary of MANOVA results
summary(manova_model)
               Df    Pillai approx F num Df den Df    Pr(>F)    
nationality     1 0.0040744  187.566      2  91695 < 2.2e-16 ***
bmi             2 0.0019451   44.633      4 183392 < 2.2e-16 ***
Residuals   91696                                               
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Interpretation of MANOVA results

  • Df: Degrees of freedom, which represent the number of independent values or quantities that can be assigned to a statistical distribution.
  • Pillai: The Pillai-Bartlett trace, a multivariate test statistic that measures the overall significance of the model and the independent variables’ effects on the dependent variables. It ranges from 0 to 1, where higher values indicate stronger effects.
  • Approx F: The approximate F-statistic associated with the Pillai-Bartlett trace. It assesses the significance of the model and the independent variables’ effects on the dependent variables.
  • num Df: The numerator degrees of freedom, representing the number of independent variables or parameters in the model.
  • den Df: The denominator degrees of freedom, representing the error or residual degrees of freedom.
  • Pr(>F): The p-value associated with the F-statistic. It indicates the probability of observing the test statistic (or one more extreme) under the null hypothesis that there are no differences between the groups defined by the independent variables. A small p-value (typically below a predetermined significance level, such as 0.05) suggests that the observed differences are statistically significant, leading to the rejection of the null hypothesis.
library(vegan)
library(microbial)
library(kableExtra)

ps_raw %>% 
betatest(group = "nationality", distance = "bray") %>%
  kable(format = "html") %>%
  kable_styling(bootstrap_options = "basic", full_width = F, position = "float_left")  %>%
  column_spec(7, bold = TRUE, color = "black", background = "#eeeeee")
Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
Group 1 6.940786 6.9407856 47.01117 0.1760644 0.001
Residuals 220 32.481061 0.1476412 NA 0.8239356 NA
Total 221 39.421847 NA NA 1.0000000 NA

ps_raw %>% 
betatest(group = "bmi_group", distance = "bray") %>%
  kable(format = "html") %>%
  kable_styling(bootstrap_options = "basic", full_width = F, position = "float_left")  %>%
  column_spec(7, bold = TRUE, color = "black", background = "#eeeeee")
Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
Group 2 2.303012 1.1515062 6.793851 0.0584197 0.001
Residuals 219 37.118834 0.1694924 NA 0.9415803 NA
Total 221 39.421847 NA NA 1.0000000 NA