Network Meta-Analysis (NMA) is a powerful statistical technique that allows researchers to compare multiple treatments simultaneously, even when some treatments have never been directly compared in head-to-head trials. This tutorial provides a comprehensive guide to conducting NMA using both frequentist and Bayesian statistical frameworks.
- 📈 Dual Approach: Master both frequentist (
netmeta
) and Bayesian (multinma
) methods - 🎨 Rich Visualizations: Generate professional plots including evidence networks, forest plots, and rankograms
- 🔍 Model Diagnostics: Learn advanced techniques for heterogeneity assessment and consistency checking
- 📊 Real Data: Work with actual clinical trial datasets (
Stowe2010
andparkinsons
) - 🎓 Educational: Step-by-step explanations suitable for beginners to advanced users
Package:
|
Package:
|
# Install required packages
install.packages(c("netmeta", "multinma", "ggplot2", "dplyr", "gridExtra"))
# Clone the repository
git clone https://github.com/dgalgom/NMA-webinar-r.git
cd NMA-webinar-r
# Run the main tutorial
source("NMA_webinar.R")
- R: Version 4.0 or higher
- RStudio: Recommended for best experience
- Operating System: Windows, macOS, or Linux
# Core packages
library(netmeta) # Frequentist NMA
library(multinma) # Bayesian NMA
library(ggplot2) # Plotting
library(dplyr) # Data manipulation
library(gridExtra) # Plot arrangements
# Additional packages (installed automatically)
# - meta, magic, MASS, coda, rjags, etc.
FROM rocker/tidyverse:latest
RUN R -e "install.packages(c('netmeta', 'multinma', 'gridExtra'))"
COPY . /home/rstudio/nma-tutorial
WORKDIR /home/rstudio/nma-tutorial
nma-tutorial-r/
├── 📄 README.md # This file
├── 📜 nma_tutorial.R # Main tutorial script
├── 📊 data/ # Sample datasets
├── 📈 outputs/ # Generated plots
├── 📚 docs/ # Additional documentation
│ ├── frequentist_guide.md # Frequentist methods
│ ├── bayesian_guide.md # Bayesian methods
│ └── interpretation_guide.md # Results interpretation
├── 🧪 examples/ # Additional examples
└── 🔧 utils/ # Helper functions
Frequentist Functions (netmeta)
Function | Purpose | Output |
---|---|---|
netmeta() |
Conduct network meta-analysis | NMA object |
netgraph() |
Plot evidence network | Network visualization |
forest() |
Create forest plots | Treatment effects plot |
rankogram() |
Generate rankograms | Treatment ranking plot |
decomp.design() |
Assess heterogeneity | Heterogeneity breakdown |
netsplit() |
Check consistency | Consistency assessment |
netheat() |
Network heat map | Inconsistency visualization |
Bayesian Functions (multinma)
Function | Purpose | Output |
---|---|---|
set_agd_arm() |
Set up network data | Network object |
nma() |
Conduct Bayesian NMA | NMA model |
plot() |
Visualize networks/results | Various plots |
relative_effects() |
Calculate treatment effects | Effect estimates |
posterior_ranks() |
Treatment rankings | Ranking probabilities |
plot_prior_posterior() |
Compare distributions | Prior vs posterior |
The tutorial generates 13 high-quality plots:
evidence_network_freq.png
- Network structureforest_plot_freq.png
- Treatment effectsrankogram_freq.png
- Treatment rankingsdecomp_design.png
- Heterogeneity decompositionnetsplit_plot.png
- Consistency checkingnetheat_plot.png
- Network heat map
evidence_network_bayes.png
- Network structureresdev_contrib.png
- Residual deviancedevdev_plot.png
- Dev-dev plotprior_posterior.png
- Prior vs posteriorrelative_effects.png
- Treatment effectstreatment_ranking.png
- Rankingscumulative_ranking.png
- Cumulative probabilities
Found a bug? Please create an issue with:
- Description: Clear description of the problem
- Reproducible Example: Minimal code to reproduce the issue
- Environment: R version, package versions, OS
- Expected vs Actual: What you expected vs what happened
Have ideas for improvements? We'd love to hear them! Please include:
- Use Case: Why this feature would be useful
- Description: Detailed description of the proposed feature
- Examples: How it would work in practice
This tutorial is perfect for:
- 👩🔬 Researchers conducting systematic reviews and meta-analyses
- 👨⚕️ Clinicians evaluating treatment effectiveness
- 🎓 Students learning network meta-analysis methods
- 📊 Statisticians comparing frequentist and Bayesian approaches
- 🏥 Health Technology Assessment agencies
- Cochrane Handbook for Systematic Reviews
- Network Meta-Analysis: An Introduction
- PRISMA-NMA Guidelines
- netmeta R package
- multinma R package
- R-INLA - Alternative Bayesian framework
If you use this tutorial in your research, please cite:
@software{nma_tutorial_r,
author = {Your Name},
title = {Network Meta-Analysis in R: A Comprehensive Tutorial},
url = {https://github.com/yourusername/nma-tutorial-r},
year = {2025},
version = {1.0.0}
}
Need help? Here's how to get support:
- 📖 Documentation: Check the docs folder
- 💬 Discussions: Use GitHub Discussions for questions
- 🐛 Issues: Report bugs via GitHub Issues
- 📧 Email: Contact daniel.gallardo@iconplc.com