Learn R Programming

twangMediation (version 1.2)

bal.table.mediation: Compute the balance table for mediation object.

Description

Compute the balance table for mediation object.

Usage

bal.table.mediation(x, digits = 3, details = FALSE, plot = FALSE, ...)

Value

res

tables detailing covariate balance across exposure groups both before and after weighting

Arguments

x

A mediation object

digits

Number of digits to round to. Dafault: 3

details

logical. If TRUE covariate balance for the models used to create the inputs into the weights used in effect estimation is checked. If FALSE the additional balance is not checked.

plot

logical. If TRUE, plots of the balance for all covariates are outputted for each type of effect (NIE0, NIE1, NDE0, NDE1, TE) for each stopping method. If FALSE, no plots are returned.

...

Additional arguments.

See Also

print.bal.table.mediation, wgtmed

Examples

Run this code
data("tMdat")

## tMdat is small simulated data set included in twangMedRiation for 
## demonstrating the functions. See ?tMdat for details

fit.es.max <- wgtmed(M ~ w1 + w2 + w3,
                      data = tMdat,
                      a_treatment = "A",
                      y_outcome = "Y",
                      total_effect_wts = tMdat$te.wgt,
                      method = "logistic"
                      )

bal.table.mediation(fit.es.max)

Run the code above in your browser using DataLab