| NMAforest | R Documentation |
This function extends the capabilities of network meta-analysis visualization by generating a forest plot that incorporates direct, indirect, and network meta-analysis (NMA) treatment effects, along with contribution proportions from individual studies and comparison paths. It builds on the statistical foundation provided by the 'netmeta' package and is particularly useful for evaluating the influence of study evidence in complex treatment networks.
NMAforest(
data,
sm,
reference,
model = "random",
comparison,
study = "study",
treat = "t",
event = "r",
N = "n",
mean = "y",
sd = "sd",
study_id = "study_id",
study_path = TRUE
)
data |
A data frame in long format with required variables
|
sm |
A Character string specifying the summary measure to use (e.g., "OR" for odds ratio, "RR" for risk ratio, "RD" for risk difference, "MD" for mean difference, "SMD" for standardized mean difference, etc.). |
reference |
Specify the reference treatment for comparisons. |
model |
Choose "random" or "fixed" effect model. |
comparison |
A vector of two treatments to compare. |
study |
Column name identifying the study label. |
treat |
Column name for treatment assignment. |
event |
Column name for event counts (for binary outcomes). |
N |
Column name for total sample size (for binary and continuous outcomes). |
mean |
Column name for mean values (for continuous outcomes). |
sd |
Column name for standard deviations (for continuous outcomes). |
study_id |
Column name used to uniquely identify each study arm (default = "study_id"). If the column is not present in the original dataset, the updated data frame will be returned with this column added. |
study_path |
Logical. TRUE to include study combination contributions, FALSE to exclude. |
This package includes an implementation of 'comparisonStreams()' originally developed by Papakonstantinou et al. (2018) and released with the paper's supplementary material.
A list containing:
A ggplot object of the forest plot.
A data frame summarizing the results for the specified treatment comparison, including study-level and overall estimates. Columns contain the effect sizes with their 95% confidence intervals, standard errors, study weights, and contribution proportions, along with labels indicating whether the row corresponds to a study, direct effect, indirect effect, or the overall NMA estimate.
The input data frame after preprocessing, with a unique
study identifier column (from the argument study_id) added when not
already present. This guarantees consistent referencing of studies in both
the analysis and the output.
Balduzzi, S., Rücker, G., Nikolakopoulou, A., Papakonstantinou, T., Salanti, G., Efthimiou, O., & Schwarzer, G. (2023). netmeta: An R Package for Network Meta-Analysis Using Frequentist Methods. *Journal of Statistical Software*, 106(2), 1–40. https://doi.org/10.18637/jss.v106.i02
Csardi, G., & Nepusz, T. (2006). The igraph software package for complex network research. *InterJournal*, Complex Systems, 1695. https://igraph.org
Csárdi, G., Nepusz, T., Traag, V., Horvát, Sz., Zanini, F., Noom, D., & Müller, K. (2025). *igraph: Network Analysis and Visualization in R*. https://doi.org/10.5281/zenodo.7682609
Wickham, H. (2016). *ggplot2: Elegant Graphics for Data Analysis*. Springer-Verlag New York. https://ggplot2.tidyverse.org
Papakonstantinou, T., Nikolakopoulou, A., Rücker, G., Chaimani, A., Schwarzer, G., Egger, M., & Salanti, G. (2018). Estimating the contribution of studies in network meta-analysis: paths, flows and streams. *F1000Research*, 7:610. https://doi.org/10.12688/f1000research.14527.3
flow_contribution GitHub repository: https://github.com/esm-ispm-unibe-ch/flow_contribution
# Example 1: Binary outcome data
data(example_data)
NMAforest(
data = example_data,
sm = "OR",
reference = "x",
model = "random",
comparison = c("x", "y"),
study = "study",
treat = "t",
event = "r",
N = "n",
study_id = "id",
study_path = TRUE
)
# Example 2: Continuous outcome data
data("parkinson", package = "pcnetmeta")
NMAforest(
data = parkinson,
sm = "MD",
reference = "1",
model = "random",
comparison = c("1", "3"),
study = "s.id",
treat = "t.id",
mean = "mean",
sd = "sd",
N = "n",
study_path = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.