Skip to content

twangMediation

1.2.1Package record

Twang Causal Mediation Modeling via Weighting

0packages depend
3.2Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

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.

Changes in 1.2.1

Bug fixes

  • Fixed linkages in several .Rd documentation files to improve cross-references.
  • Updated the check of the object submitted to print.bal.table.mediation to use inherits() for more robust class validation.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 2.8 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 1.2.1
READMENoVignettesYes · 1 · staticNEWSYes · 67% structured · mentions 1.2.1Citation fileNoWebsitenot declared in DESCRIPTION
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

3.2K
CRAN downloads in the past year
Rank #15,420 · ~9/day · ~268/mo
Daily download trend is not available in this view yet.
28930 days
79990 days
3.2K1 year
Compare downloads with other packages →
Also on112 r2u3 autocran86 c2d4u

Dependencies

Declared dependencies
7 external dependencies (excludes base and recommended)

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.

Depends (1)
R >= 2.10
Imports (8)
LinkingTo (0)
none
Suggests (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (6)
Author, Maintainer since 1.0 (2021)
Releases (4)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 1.2.1Latest
    record
    2025-11-16 · current release · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • 1.2
    record
    2022-08-16 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 1.1
    record
    2021-12-13 · diff ↗
  • 1.0
    record
    2021-07-27
  • R
    R 4.1.0 released · 2021-05-18

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
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("twangMediation")
McCaffrey, D., Castellano, K., Coffman, D., Schuler, M., Vegetabile, B., & Zhou, H. (2025). twangMediation: Twang Causal Mediation Modeling via Weighting (Version 1.2.1) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for twangMediation version 1.2.1 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy