| DR | R Documentation |
Doubly robust estimator
DR(Y, Z, interZ = formula(~1), Z.hat, Y1.hat, Y0.hat, data)
Y |
continuous outcome variable |
Z |
binary treatment indicator, 1 - treatment, 0 - control |
interZ |
formula that contains the variables that "interact" with the treatment. "1" will be always added. The default is no interaction, i.e., formula = formula(~1). |
Z.hat |
treatment/propensity score prediction from |
Y1.hat |
outcome prediction among treated units from |
Y0.hat |
outcome prediction among untreated units from |
data |
dataframe containing the variables in the model |
estimates and standard errors
DRPRcomb.rslt <- DRPRcomb(Y=twolevel_data$Y, Z=twolevel_data$Z, interZ=(~ W1),
X=twolevel_data[, c("X1", "X2", "X3", "W1")], ID=twolevel_data$id,
library="glm", data=twolevel_data) # the default algorithms are "glm" and "deeplearning".
# with final predictions
DR(Y=twolevel_data$Y, Z=twolevel_data$Z, interZ=(~ W1), Z.hat=DRPRcomb.rslt$Z.hat,
Y1.hat=DRPRcomb.rslt$Y1.hat, Y0.hat=DRPRcomb.rslt$Y0.hat, data=twolevel_data)
# with predictions from glm with fixed effects of clusters
DR(Y=twolevel_data$Y, Z=twolevel_data$Z, interZ=(~ W1),
Z.hat=DRPRcomb.rslt$Z.hats$Ztest.hat_glm_1, Y1.hat=DRPRcomb.rslt$Y1.hats$Y1test.hat_glm_1,
Y0.hat=DRPRcomb.rslt$Y0.hats$Y0test.hat_glm_1, data=twolevel_data)
# with predictions from glm wtih random effects of clusters
DR(Y=twolevel_data$Y, Z=twolevel_data$Z, interZ=(~ W1),
Z.hat=DRPRcomb.rslt$Z.hats$Ztest.hat_glm_3, Y1.hat=DRPRcomb.rslt$Y1.hats$Y1test.hat_glm_3,
Y0.hat=DRPRcomb.rslt$Y0.hats$Y0test.hat_glm_3, data=twolevel_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.