2026-04-12

What is the Microbiome?

The microbiome is the collection of bacteria, fungi, and viruses that live on and in each of our bodies. Studies have found that our microbiomes are vitally important to our wellbeing. And that the microbiome plays a role in ensuring proper digestion, immune function and overall health.

Why does microbiome diversity matter?

Microbiome diversity refers to how many different types of microorganisms are present and how evenly they are distributed.

Higher diversity is often associated with: - better gut health - stronger immune function - greater stability against infections

Lower diversity has been linked to: - infections and disease - inflammation - reduced resilience to environmental changes

Because of this, comparing diversity between groups can help us understand differences in health outcomes.

Measuring Microbiome Diversity

Microbiome diversity can be quantified using statistical measures, such as the Shannon Index.

The Shannon Index accounts for: - the number of species present (richness) - the relative abundance of each species (evenness)

Higher values indicate greater diversity, while lower values indicate less diversity.

\[ H = -\sum (p_i \log p_i) \]

Data Description

The dataset consists of microbiome samples from two groups: - Healthy individuals - Diseased individuals

Each sample is assigned a Shannon Diversity Index value.

We will use statistical methods to compare diversity between the groups and assess whether any observed differences are significant.

Microbiome Diversity by Group

This boxplot compares Shannon diversity index values between healthy and diseased individuals. The healthy group appears to have higher diversity on average, while the diseased group appears to have lower diversity. This suggests there may be a difference between the groups, which can be tested statistically.

Distribution of Microbiome Diversity

This histogram shows the distribution of Shannon diversity values for each group.

The healthy group tends to have higher diversity values, while the diseased group is shifted toward lower values.

The difference in distributions suggests there may be a meaningful difference between the groups.

Hypothesis Testing

We test whether microbiome diversity differs between groups.

Null hypothesis: \[ H_0: \mu_{healthy} = \mu_{diseased} \]

Hypothesis Testing (continued)

Alternative hypothesis: \[ H_1: \mu_{healthy} \neq \mu_{diseased} \]

We use a two-sample t-test to compare the group means.

## 
##  Welch Two Sample t-test
## 
## data:  Shannon by Group
## t = -12.676, df = 97.93, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group Diseased and group Healthy is not equal to 0
## 95 percent confidence interval:
##  -1.3161944 -0.9598588
## sample estimates:
## mean in group Diseased  mean in group Healthy 
##               3.372584               4.510610

Results

A two-sample t-test was performed to compare microbiome diversity between groups.

The p-value obtained from the test is less than 0.05.

Since the p-value is small, we reject the null hypothesis.

This suggests that there is a statistically significant difference in microbiome diversity between healthy and diseased individuals.

Conclusion

The analysis suggests that microbiome diversity is significantly different between groups.

Healthy individuals tend to have higher diversity compared to diseased individuals.

This highlights the importance of microbiome diversity in human health.

Statistical methods such as hypothesis testing provide a useful tool for analyzing biological data.

R Code Example

The following R code was used to create the boxplot comparing microbiome diversity between groups:

library(ggplot2)

ggplot(microbiome_data, aes(x = Group, y = Shannon, fill = Group)) +
  geom_boxplot() +
  labs(
    title = "Microbiome Diversity by Group",
    x = "Group",
    y = "Shannon Diversity Index"
  ) +
  scale_fill_manual(values = c("Healthy" = "darkseagreen",
                               "Diseased" = "seagreen")) +
  theme_minimal()

Interactive Visualization

library(plotly)