Learn R Programming

contourforest (version 0.2.0)

forest_cont_subgroup: Forest Plot for Subgroup Meta-Analysis

Description

Creates a detailed forest plot for subgroup meta-analysis, including study-level effect sizes, subgroup pooled effects, heterogeneity statistics, overall pooled effect, and prediction intervals.

Usage

forest_cont_subgroup(
  dat,
  m_t_col = "mean_t",
  sd_t_col = "sd_t",
  n_t_col = "n_t",
  m_c_col = "mean_c",
  sd_c_col = "sd_c",
  n_c_col = "n_c",
  subgroup_col = "subgroup",
  study_col = "Study",
  measure = "SMD",
  method = "REML",
  xlab = NULL,
  xlim = NULL,
  model = "RE",
  title = "Subgroup Forest Plot",
  diamond.col = "red",
  overall.col = "darkgreen",
  study.col = "blue",
  CI.col = "blue",
  Pred.Inter.col = "black",
  square.size = 5,
  Pred.Int.size = 1.5,
  text_size = 3.5,
  pred = TRUE,
  xpos = list(Study = NULL, MeanT = NULL, MeanC = NULL, Effect = NULL, Weight = NULL,
    PredInt = NULL, Hetero = NULL)
)

Value

A ggplot object representing the subgroup forest plot.

Arguments

dat

A data frame containing the study-level data. Use dat1 included in the package for examples.

m_t_col

Name of the column for treatment group means.

sd_t_col

Name of the column for treatment group standard deviations.

n_t_col

Name of the column for treatment group sample sizes.

m_c_col

Name of the column for control group means.

sd_c_col

Name of the column for control group standard deviations.

n_c_col

Name of the column for control group sample sizes.

subgroup_col

Name of the column indicating subgroup membership.

study_col

Name of the column with study labels.

measure

Effect size measure: "SMD" (standardized mean difference) or "MD" (mean difference).

method

Method for meta-analysis: "REML" (default) or "FE".

xlab

Label for the x-axis.

xlim

Limits for the x-axis as a numeric vector of length 2.

model

Random-effects ("RE") or fixed-effects ("FE") model for pooled estimates.

title

Plot title.

diamond.col

Color for subgroup pooled effect diamonds.

overall.col

Color for the overall pooled effect diamond.

study.col

Color for study-level points.

CI.col

Color for confidence intervals of individual studies.

Pred.Inter.col

Color for the overall prediction interval.

square.size

Maximum size of study-level effect squares.

Pred.Int.size

Line thickness for prediction interval.

text_size

Base text size for annotations.

pred

Logical; if TRUE, display overall prediction interval.

xpos

numeric vector of x-axis positions for annotations

Examples

Run this code
# Using the built-in dataset dat1
forest_cont_subgroup(dat1)

Run the code above in your browser using DataLab