Learn R Programming

twangMediation (version 1.2)

Twang Causal Mediation Modeling via Weighting

Description

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). Huber, M. (2014). ). 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.

Copy Link

Version

Install

install.packages('twangMediation')

Monthly Downloads

156

Version

1.2

License

GPL-3

Maintainer

Dan McCaffrey

Last Published

August 16th, 2022

Functions in twangMediation (1.2)

desc.effects.mediation

Describe the effects from a mediation object
print.bal.table.mediation

Default print statement for mediation class
calculate_effects

Calculate the actual effects
bal.table.mediation

Compute the balance table for mediation object.
tMdat

Simulated data for twangMediation
summary.mediation

Displays a useful description of a mediation object.
plot.mediation

Plot the mediation object.
check_missing

Check vector for NA or NAN values.
NSDUH_female

A dataset containing the substance use condition and sexual orientation of 40293 women respondents to the 2017 & 2018 National Survey of Drug Use and Health.
weighted_mean

Calculate a weighted mean.
wgtmed

Weighted mediation analysis.
twangMediation-package

twangMediation: Twang Causal Mediation Modeling via Weighting
swapTxCtrl

Auxiliary function to swap treatment and control in one element of a desc object from a ps object or dx.wts object
dx.wts.mediation

Compute diagnostics assessing covariates balance.
desc.effects

Describe the effects
print.mediation

Default print statement for mediation class