DR: Doubly robust estimator

View source: R/combFun.R

DRR Documentation

Doubly robust estimator

Description

Doubly robust estimator

Usage

DR(Y, Z, interZ = formula(~1), Z.hat, Y1.hat, Y0.hat, data)

Arguments

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 DRPRcomb

Y1.hat

outcome prediction among treated units from DRPRcomb

Y0.hat

outcome prediction among untreated units from DRPRcomb

data

dataframe containing the variables in the model

Value

estimates and standard errors

Examples

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)

youmisuk/CURobustML documentation built on Sept. 11, 2022, 11:04 a.m.