Twang Causal Mediation Modeling via Weighting
Overview
Provides functions for estimating natural direct and indirect effects for mediation analysis. It uses weighting where the weights are functions of estimates of the probability of exposure or treatment assignment (Hong, G (2010). https://cepa.stanford.edu/sites/default/files/workshops/GH_JSM%20Proceedings%202010.pdf Huber, M. (2014). doi:10.1002/jae.2341). Estimation of probabilities can use generalized boosting or logistic regression. Additional functions provide diagnostics of the model fit and weights. The vignette provides details and examples.
Bug fixes
- Fixed linkages in several
.Rddocumentation files to improve cross-references. - Updated the check of the object submitted to
print.bal.table.mediationto useinherits()for more robust class validation.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 16includes a package overview page
- Examples that run
- 82%9 run in a plain check · 2 never run
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Dependencies
Installing twangMediation adds 38 packages (21 with compiled code, 36 MB of source tarballs). Heaviest: ggplot2 6.0 MB, data.table 5.7 MB, survey 2.3 MB.
Code & Tests
Datasets
People & History
Package metadata
- First published
- 2021-07-27
- Total releases
- 4 / 5 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 2.10
- Bundled data
- 520 KB / 2 files
- Download size
- 1.0 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("twangMediation")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.