Learn R Programming

cobalt (version 4.4.1)

bal.tab.CBPS: Balance statistics for CBPS Objects

Description

Generates balance statistics for CBPS and CBMSM objects from the CBPS package.

Usage

# S3 method for CBPS
bal.tab(x, 
        stats,
        int = FALSE,
        poly = 1,
        distance = NULL,
        addl = NULL,
        data = NULL,
        continuous,
        binary,
        s.d.denom,
        thresholds = NULL,
        weights = NULL,
        cluster = NULL,
        imp = NULL,
        pairwise = TRUE,
        s.weights = NULL,
        abs = FALSE,
        subset = NULL,
        quick = TRUE,
        ...)

Value

For point treatments, if clusters are not specified, an object of class "bal.tab" containing balance summaries for the CBPS object. See bal.tab() for details.

If clusters are specified, an object of class "bal.tab.cluster" containing balance summaries within each cluster and a summary of balance across clusters. See bal.tab.cluster for details.

If CBPS() is used with multi-category treatments, an object of class "bal.tab.multi" containing balance summaries for each pairwise treatment comparison and a summary of balance across pairwise comparisons. See bal.tab.multi for details.

If CBMSM() is used for longitudinal treatments, an object of class "bal.tab.msm" containing balance summaries for each time period and a summary of balance across time periods. See bal.tab.msm for details.

Arguments

x

a CBPS or CBMSM object; the output of a call to CBPS::CBPS() or CBPS::CBMSM().

stats, int, poly, data, continuous, binary, thresholds, weights, cluster, imp, pairwise, abs, subset, quick, ...

see bal.tab() for details.

See below for special notes on the distance, addl, s.d.denom, and s.weights arguments.

The following arguments have special notes when used with CBPS or CBMSM objects:

distance

propensity scores generated by CBPS() and CBMSM() are automatically included and named "prop.score". For CBMSM objects, each dataset in the list supplied to distance must have one row per individual, unlike the data frame in the original call to CBMSM().

addl

for CBMSM objects, each dataset in the list supplied to addl must have one row per individual, unlike the data frame in the original call to CBMSM().

s.d.denom

if not specified, bal.tab() will use "treated" if the estimand of the call to CBPS() is the ATT and "pooled" if the estimand is the ATE.

s.weights

the CBPS object does not return sampling weights even if they are used; rather, the weights returned already have the sampling weights combined within them. Because some of the checks and defaults in bal.tab() rely on patterns in these weights, using sampling weights in CBPS() without specifying them in bal.tab() can lead to incorrect results. If sampling weights are used in CBPS(), it is important that they are specified in bal.tab() as well using the s.weights argument.

Author

Noah Greifer

Details

bal.tab.CBPS() and bal.tab.CBMSM() generate a list of balance summaries for the CBPS or CBMSM object given and functions similarly to CBPS::balance().

See Also

bal.tab() for details of calculations. bal.tab.cluster for more information on clustered data. bal.tab.multi for more information on multi-category treatments. bal.tab.msm for more information on longitudinal treatments.

Examples

Run this code
if (FALSE) { # requireNamespace("CBPS", quietly = TRUE)
library(CBPS)
data("lalonde", package = "cobalt")

## Using CBPS() for generating covariate balancing 
## propensity score weights
cbps.out <- CBPS(treat ~ age + educ + married + race +
             nodegree + re74 + re75, data = lalonde)
             
bal.tab(cbps.out)
}

Run the code above in your browser using DataLab