Learn R Programming

cobalt (version 4.4.1)

bal.tab.sbwcau: Balance Statistics for sbw Objects

Description

Generates balance statistics for sbwcau objects from sbw.

Usage

# S3 method for sbwcau
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

If clusters are not specified, an object of class "bal.tab" containing balance summaries for the sbwcau 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.

Arguments

x

an sbwcau object; the output of a call to sbw::sbw().

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

see bal.tab() for details.

See below for a special note on the s.d.denom argument.

The following argument has a special note when used with sbwcau objects:

s.d.denom

if not specified, bal.tab() will figure out which one is best based on the par component of the sbwcau object: if "att", "treated"; if "atc", "control"; otherwise "pooled".

Author

Noah Greifer

Details

bal.tab.sbwcau() generates a list of balance summaries for the sbwcau object given, and functions similarly to sbw::summarize().

See Also

bal.tab() for details of calculations.

Examples

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

## Stable balancing weights for the ATT
sbw.out <- sbw(splitfactor(lalonde, drop.first = "if2"),
               ind = "treat",
               bal = list(bal_cov = c("age", "educ", "race_black", 
                                      "race_hispan", "race_white", 
                                      "married", "nodegree", 
                                      "re74", "re75"),
                          bal_alg = FALSE, 
                          bal_tol = .001),
               par = list(par_est = "att"))
               
bal.tab(sbw.out, un = TRUE, poly = 2)
}

Run the code above in your browser using DataLab