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

View source: R/eb_wrappers.R

eb_ateR Documentation

Estimate Energy Balancing Weights for the Average Treatment Effect

Description

eb_ate is a wrapper for energybalance that focuses on using it to estimate energy balancing weights for the average treatment effect (ATE). The combined energy distance between each treatment and the full sample is minimized.

Usage

eb_ate(sampleX, Z, sampleW = NULL, std = "studentized",
       improved = TRUE, 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 target distribution (weighted by sampleW if supplied). If "mahalanobis", the distance matrix used will be the Mahalanobis distance computed using the covariance matrix of the target distribution (weighted by sampleW if supplied). If "none", the distance matrix used will be the Euclidean distance matrix. Default is "studentized". Abbreviations allowed.

improved

logical; whether to additionally balance the distributions between treatment groups. If TRUE, the energy distance between treatment groups and between each treatment group and the full sample distribution will be minimized. If FALSE, only the energy distance between each treatment group and the full sample distribution will be minimized. Default is TRUE as recommended by Huling and Mak (2020).

lambda

a penalty on the sum of the squared weights. lambda/nrow(sampleX)^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.

Author(s)

Noah Greifer

See Also

energybalance for a more flexible interface that allows matching both groups to a target distribution other than the full sample.

edist_ate for the quantity that eb_ate minimizes.

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.