method_npcbps | R Documentation |
This page explains the details of estimating weights from nonparametric covariate balancing propensity scores by setting method = "npcbps"
in the call to weightit()
or weightitMSM()
. This method can be used with binary, multi-category, and continuous treatments.
In general, this method relies on estimating weights by maximizing the empirical likelihood of the data subject to balance constraints. This method relies on \pkgfunCBPSnpCBPS from the CBPS package.
For binary treatments, this method estimates the weights using \pkgfunCBPSnpCBPS. The ATE is the only estimand allowed. The weights are taken from the output of the npCBPS
fit object.
For multi-category treatments, this method estimates the weights using \pkgfunCBPSnpCBPS. The ATE is the only estimand allowed. The weights are taken from the output of the npCBPS
fit object.
For continuous treatments, this method estimates the weights using \pkgfunCBPSnpCBPS. The weights are taken from the output of the npCBPS
fit object.
For longitudinal treatments, the weights are the product of the weights estimated at each time point. This is not how \pkgfunCBPSCBMSM estimates weights for longitudinal treatments.
Sampling weights are not supported with method = "npcbps"
.
In the presence of missing data, the following value(s) for missing
are allowed:
"ind"
(default)First, for each variable with missingness, a new missingness indicator variable is created which takes the value 1 if the original covariate is NA
and 0 otherwise. The missingness indicators are added to the model formula as main effects. The missing values in the covariates are then replaced with the covariate medians (this value is arbitrary and does not affect estimation). The weight estimation then proceeds with this new formula and set of covariates. The covariates output in the resulting weightit
object will be the original covariates with the NA
s.
M-estimation is not supported.
Nonparametric CBPS involves the specification of a constrained optimization problem over the weights. The constraints correspond to covariate balance, and the loss function is the empirical likelihood of the data given the weights. npCBPS is similar to entropy balancing and will generally produce similar results. Because the optimization problem of npCBPS is not convex it can be slow to converge or not converge at all, so approximate balance is allowed instead using the cor.prior
argument, which controls the average deviation from zero correlation between the treatment and covariates allowed.
moments
and int
are accepted. See weightit()
for details.
quantile
A named list of quantiles (values between 0 and 1) for each continuous covariate, which are used to create additional variables that when balanced ensure balance on the corresponding quantile of the variable. For example, setting quantile = list(x1 = c(.25, .5. , .75))
ensures the 25th, 50th, and 75th percentiles of x1
in each treatment group will be balanced in the weighted sample. Can also be a single number (e.g., .5
) or an unnamed list of length 1 (e.g., list(c(.25, .5, .75))
) to request the same quantile(s) for all continuous covariates, or a named vector (e.g., c(x1 = .5, x2 = .75)
to request one quantile for each covariate. Only allowed with binary and multi-category treatments.
All arguments to npCBPS()
can be passed through weightit()
or weightitMSM()
.
All arguments take on the defaults of those in npCBPS()
.
obj
When include.obj = TRUE
, the nonparametric CB(G)PS model fit. The output of the call to \pkgfunCBPSnpCBPS.
Fong, C., Hazlett, C., & Imai, K. (2018). Covariate balancing propensity score for a continuous treatment: Application to the efficacy of political advertisements. The Annals of Applied Statistics, 12(1), 156–177. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/17-AOAS1101")}
weightit()
, weightitMSM()
, method_cbps
CBPSnpCBPS for the fitting function
# Examples take a long time to run
library("cobalt")
data("lalonde", package = "cobalt")
#Balancing covariates between treatment groups (binary)
(W1 <- weightit(treat ~ age + educ + married +
nodegree + re74, data = lalonde,
method = "npcbps", estimand = "ATE"))
summary(W1)
bal.tab(W1)
#Balancing covariates with respect to race (multi-category)
(W2 <- weightit(race ~ age + educ + married +
nodegree + re74, data = lalonde,
method = "npcbps", estimand = "ATE"))
summary(W2)
bal.tab(W2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.