eb_att: Estimate Energy Balancing Weights for the Average Treatment...

View source: R/eb_wrappers.R

eb_attR Documentation

Estimate Energy Balancing Weights for the Average Treatment Effect on the Treated

Description

eb_att is a wrapper for energybalance that focuses on using it to estimate energy balancing weights for the average treatment effect on the treated (ATT) with one or more control (non-focal) groups. The energy distance between each non-focal treatment group and the focal treatment group is minimized.

Usage

eb_att(sampleX, Z, sampleW = NULL, std = "studentized",
       focal = NULL, improved = FALSE, lambda = 0)

Arguments

sampleX

a matrix or data frame of covariates composing the sample distribution to be weighted. See energybalance for how this is processed.

Z

a vector denoting treatment group membership.

sampleW

optional; a vector of sampling weights for the sample. The product of the estimated weights and sampleW will be the distribution-matching weights.

std

character; whether to standardize the covariates. If "studentized", the distance matrix used will be the Euclidean distance with each variable scaled using its standard deviation in the focal treatment group distribution (weighted by sampleW if supplied). If "mahalanobis", the distance matrix used will be the Mahalanobis distance computed using the covariance matrix of the focal treatment group distribution (weighted by sampleW if supplied). If "none", the distance matrix used will be the Euclidean distance matrix. Default is "studentized". Abbreviations allowed.

focal

a value of the Z to be considered the "focal" or "treated" group. If NULL, if Z is a factor, then focal = levels(Z)[nlevels(Z)], and otherwise, focal = max(Z).

improved

logical; whether to additionally balance the distributions between non-treatment groups when there are more than two groups. If TRUE, the energy distance between non-focal treatment groups and between each non-focal treatment group and the focal treatment group distribution will be minimized. If FALSE, only the energy distance between each non-focal treatment group and the focal treatment group distribution will be minimized. Default is FALSE unlike other functions in the package. With only two groups, this argument is ignored.

lambda

a penalty on the sum of the squared weights. lambda/sum(Z!=focal)^2 times the sum of the squared weights is added to the objective function. Increasing lambda preserves the effective sample size of the weighted sample at the expense of balance.

Value

A vector of weights, one for each row of sampleX. Weights for which Z == focal will be 1.

Author(s)

Noah Greifer

See Also

energybalance for a more flexible interface.

eb_ate for weights for estimating the average treatment effect (ATE).

eb_target for weights that match a sample to a target, which can also be used for estimating ATT weights.

method_energy for the implementation of energy balancing in WeightIt, which has additional options to restrict the difference in means between covariates.


ngreifer/energybalance documentation built on July 27, 2022, 5:50 a.m.