@misc{cmaverse,
title = {CMAverse},
author = {Shi and Valeri and others},
howpublished = {\url{https://bs1125.github.io/CMAverse/}},
note = {Software / documentation}
}Decompose a total effect into what flows through the mediator (NIE) and what doesn't (NDE) using a g-formula / weighting backend. Pair with a sensitivity analysis: how strong an unmeasured mediator–outcome confounder would need to be to overturn the conclusion.
Input · what goes in
A treatment, a mediator on the causal path, an outcome, and the confounders of each link.
Show data format & exampleHide example
Format — one row per unit: treatment a, mediator m, outcome y, confounders C.
a m y c1 c2
1 0.6 3.2 0.4 -1.1
0 0.2 1.8 -0.1 0.6
Pipeline · the recipe ⑂ has parallel branches
↑ Click any step in the diagram to read its logic, code, assumptions & discussion.
Treatment, mediator, outcome, confounders
Data preparation — shapes the raw inputs into what the estimator expects.
Lay out the mediation DAG and the confounders of the A→M, A→Y and M→Y links.
library(CMAverse)
# a (treatment), m (mediator), y (outcome), C (confounders)
- No comments on this step yet — be the first.
Log in to comment on this step.
Fit mediator & outcome models
The core estimate — where the causal quantity itself is computed.
A regression/g-formula (or weighting) approach to both models.
cmest(data=df, model='rb', outcome='y', exposure='a',
mediator='m', basec=C, EMint=TRUE)
- No comments on this step yet — be the first.
Log in to comment on this step.
Decompose the total effect
Uncertainty quantification — standard errors, intervals, and aggregation.
Report the natural direct and indirect effects (and the mediated proportion).
summary(res) # NDE, NIE, total, proportion mediated
- No comments on this step yet — be the first.
Log in to comment on this step.
Sensitivity to mediator–outcome confounding
A robustness check — does the headline result survive a different lens?
How strong an unmeasured M–Y confounder would overturn the conclusion.
cmsens(res, sens='uc')
- No comments on this step yet — be the first.
Log in to comment on this step.
Output · what you get 2 figures
Figures reproduced from CMAverse — Shi, Valeri et al. — unofficial community showcase; all credit to the original authors.
⚠️ Unofficial community showcase of cmaverse. Not affiliated with the authors; all credit to them.
Split a total effect into what flows through a mediator (indirect) and what doesn't (direct) — with a sensitivity analysis for mediator–outcome confounding.
Discussion (0)
Log in to join the discussion.