Skip to content

Latest commit

 

History

108 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nmatools

R package providing one-stop wrappers for network meta-analysis (NMA) using the netmeta package: a scripted pipeline that fits a network and writes a complete set of results and publication-ready figures to disk, a suite of publication visualizations, and an interactive CINeMA + ROB-MEN Shiny GUI for rating confidence in the results.

Documentation

The full user manual lives in docs/manual/. Start at the manual home for reading paths, or jump to a chapter below.

Getting started

Chapter Topic
1. Installation and quick start Requirements, install, five-minute NMA
2. Data formats Input formats, w2i_trials, helpers, project setup

Scripted pipeline

Chapter Topic
3. The NMA pipeline netmetawrap() arguments, outputs, overrides, subnetworks
4. Batch runs and rare events run_nma_batch() and the Mantel-Haenszel rare-event workflow
5. Transitivity plot_transitivity() covariate plots

GUI guide

Chapter Topic
6. GUI overview Launch modes and workflow
7. Configuration tab Loading data, NMA and ROB-MEN settings, running
8. CINeMA domains Domain tabs ①③④⑤⑥
9. ROB-MEN Domain ② and the ROB-MEN assessment
10. Report and export Summary grid, figures, ZIP bundle

Visualizations

Chapter Topic
11. Colored league tables color_league() / color_league_multi()
12. Colored forest and network graphs color_forest() / color_netgraph() / palettes
13. Kilim and Vitruvian plots kilim() / vitruvian()

Evidence frameworks

Chapter Topic
14. Evidence frameworks min_context() / part_context()

Reference

Chapter Topic
15. Troubleshooting and FAQ Common problems by symptom
16. Function reference All exported functions and the literature reference list

Install

# Install from GitHub (recommended)
# install.packages("remotes")   # if not yet installed
remotes::install_github("ykfrkw/nmatools", force = TRUE)

Dependencies (netmeta, meta, dplyr, writexl, magick, and others) are installed automatically. Requires R ≥ 4.1 and a recent netmeta (≥ 3.x); see Chapter 1.

Quick start

A single netmetawrap() call fits the NMA for one outcome and writes every result — the fitted model, consistency tests, a league table, and a set of publication-ready plots — to ./outputs/{outcome}/.

library(nmatools)

d <- load_w2i()   # bundled W2I insomnia sample data (Furukawa et al. 2024)

netmetawrap(
  data            = d,
  studlab         = "id",
  treat           = "t",
  outcome         = "remission_lt",  # also names the output sub-directory
  n               = "n",
  event           = "r",
  sm              = "OR",
  reference.group = "Pharmacotherapy",
  small.values    = "undesirable"
)
# → results are written to outputs/remission_lt/

Forest plot versus the reference treatment

League table colored by CINeMA confidence

See Chapter 3 for the full output-file table and override hooks, and Chapter 4 to run many outcomes at once with run_nma_batch().

Interactive GUI (CINeMA + ROB-MEN)

cinema() launches a Shiny application for interactive confidence assessment, implementing CINeMA (Nikolakopoulou et al. 2020) and ROB-MEN (Chiocchia et al. 2021). Launch it empty or pre-load a data frame, then work left to right through the domain tabs to the Report and export bundle — see Chapters 6–10.

library(nmatools)

cinema()                                          # launch empty; upload in the GUI
cinema(load_w2i(), format = "binary", effect_measure = "OR")   # pre-load from R

The CINeMA report summary table

Sample data

w2i_trials — arm-level data from the Furukawa et al. (2024) W2I NMA. Three treatments (CBT-I, Combination, Pharmacotherapy) for chronic insomnia; four binary outcomes (remission and dropout at long-term and post-treatment). The column dictionary is documented in Chapter 2.

d  <- load_w2i()            # arm-level trial data
ci <- w2i_cinema_path()     # path to bundled CINeMA CSV (remission_lt only)

Furukawa Y, Sakata M, Furukawa TA, Efthimiou O, Perlis M. Initial treatment choices for long-term remission of chronic insomnia disorder in adults: a systematic review and network meta-analysis. Psychiatry Clin Neurosci. 2024;78(11):646-653. https://doi.org/10.1111/pcn.13730

Citation

nmatools is a wrapper around netmeta and meta. If you use it in published research, please also cite those packages directly. The full literature reference list is in Chapter 16.

citation("netmeta")
citation("meta")

About

Network Meta-Analysis Tools: wrapper functions for netmeta with automated output, forest plots, and subnetwork detection

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages