eb_mediation | R Documentation |
eb_mediation
is a wrapper for energybalance
that focuses on using it to estimate energy balancing weights for the mean cross-world potential outcome in mediation analysis. Estimation proceeds in two steps. First, the control group covariate distribution is weighted to resemble the full sample. Second, the treated group covariate and mediator distribution is weighted to resemble the weighted control group. Weights are produced for the treated group.
eb_mediation(sampleX, Z, M, sampleW = NULL, std = "studentized", lambda = 0)
sampleX |
a matrix or data frame of covariates composing the sample distribution to be weighted. See |
Z |
a vector denoting treatment group membership. The group with |
M |
a vector or matrix containing the values of the mediator(s). This is processed the same way as |
sampleW |
optional; a vector of sampling weights for the sample. The product of the estimated weights and |
std |
|
lambda |
a penalty on the sum of the squared weights. |
A vector of weights for the treated group.
Noah Greifer
energybalance
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.