| name | meta-analysis |
| description | Use when performing meta-analysis, pooling study data, generating forest plots, funnel plots, assessing heterogeneity, or conducting subgroup and sensitivity analyses. Invoke for any statistical synthesis of multiple studies. |
Meta-Analysis Skill
This skill guides statistical synthesis of multiple studies using R.
When to Use
Invoke this skill when the user:
- Asks to pool study results or combine data
- Requests forest plot or funnel plot
- Asks about heterogeneity (I², Q, tau²)
- Wants subgroup or sensitivity analysis
- Mentions "meta-analysis" or "synthesis"
- Needs publication bias assessment
R Packages Required
library(meta)
library(metafor)
library(dmetar)
Analysis Types
Binary Outcomes (OR, RR, RD)
Use metabin() for dichotomous data:
ma <- metabin(
event.e = events_intervention,
n.e = n_intervention,
event.c = events_control,
n.c = n_control,
studlab = study_id,
data = data,
sm = "OR",
method = "MH",
random = TRUE,
prediction = TRUE
)
summary(ma)
Continuous Outcomes (MD, SMD)
Use metacont() for continuous data:
ma <- metacont(
n.e = n_intervention,
mean.e = mean_intervention,
sd.e = sd_intervention,
n.c = n_control,
mean.c = mean_control,
sd.c = sd_control,
studlab = study_id,
data = data,
sm = "SMD",
random = TRUE
)
Single-Arm Proportions
Use metaprop() for single-arm rates:
ma <- metaprop(
event = events,
n = total,
studlab = study_id,
data = data,
sm = "PLOGIT",
random = TRUE
)
Hazard Ratios (Time-to-Event)
Use metagen() for pre-calculated HRs:
ma <- metagen(
TE = log(HR),
seTE = (log(HR_upper) - log(HR_lower)) / 3.92,
studlab = study_id,
data = data,
sm = "HR",
random = TRUE
)
Forest Plot
png("forest_plot.png", width=1200, height=800, res=150)
forest(ma,
sortvar = TE,
xlim = c(0.1, 10),
at = c(0.1, 0.25, 0.5, 1, 2, 4, 10),
leftcols = c("studlab", "n.e", "n.c"),
leftlabs = c("Study", "n (Int)", "n (Ctrl)"),
rightcols = c("effect", "ci"),
rightlabs = c("OR", "95% CI"),
prediction = TRUE
)
dev.off()
Heterogeneity Interpretation
| I² Value | Interpretation |
|---|
| 0-25% | Low heterogeneity |
| 25-50% | Moderate heterogeneity |
| 50-75% | Substantial heterogeneity |
| >75% | Considerable heterogeneity |
Key statistics to report:
- I²: Percentage of variability due to heterogeneity
- τ²: Between-study variance (tau-squared)
- Q: Cochran's Q statistic and p-value
- Prediction interval: Range of true effects
Subgroup Analysis
update(ma, subgroup = study_design, tau.common = FALSE)
forest(ma, subgroup = study_design, test.subgroup = TRUE)
Sensitivity Analysis
metainf(ma, pooled = "random")
influence(ma)
ma_low_rob <- update(ma, subset = rob_overall != "High")
Publication Bias
png("funnel_plot.png", width=800, height=600, res=150)
funnel(ma, studlab = TRUE)
dev.off()
metabias(ma, method.bias = "Egger")
metabias(ma, method.bias = "Begg")
tf <- trimfill(ma)
summary(tf)
funnel(tf)
Output Requirements
Always report:
- Number of studies and total participants
- Pooled effect estimate with 95% CI
- P-value for overall effect
- I² with interpretation
- τ² (for random-effects)
- Prediction interval (if using random-effects)
- Publication bias tests (if ≥10 studies)
Example Complete Analysis
library(meta)
data <- read.csv("extraction_data.csv")
ma <- metabin(
event.e = events_int, n.e = n_int,
event.c = events_ctrl, n.c = n_ctrl,
studlab = study_id, data = data,
sm = "OR", method = "MH", random = TRUE
)
summary(ma)
png("forest_plot.png", width=1200, height=800, res=150)
forest(ma, sortvar=TE, prediction=TRUE)
dev.off()
png("funnel_plot.png", width=800, height=600, res=150)
funnel(ma)
dev.off()
metabias(ma, method.bias="Egger")
metainf(ma)