| DRPRcomb | R Documentation |
Doubly robust estimator with proxy regressions with treatment and outcome learners
DRPRcomb(
Y,
Z,
X,
interZ = formula(~1),
ID,
data,
library = c("glm", "deeplearning"),
crossFitting = FALSE,
K = 5,
mCrossFit = 100
)
Y |
continuous outcome variable |
Z |
binary treatment indicator, 1 - treatment, 0 - control |
X |
vector, matrix, or dataframe containing measured confounders |
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). |
ID |
cluster identifier |
data |
dataframe containing the variables in the model |
library |
character vector of prediction algorithms. The available methods are glm, deeplearning, gbm, and randomForests. The default methods are glm and deeplearning. Three types of glm include: glm with cluster dummies, glm with cluster-constant components of individual-level covariates, and glmm with random effects of clusters. |
crossFitting |
whether to do cross fitting. The default is FALSE, and currently it is not available. |
K |
number of folds. The default is 5, and currently it is not available. |
mCrossFit |
number of cross fitting. The default is FALSE, and currently it is not available. |
An DRPRcomb with the following elements:
coef.ER |
vector of the coefficients for prediction algorithms in the treatment model |
coef.OR |
vector of the coefficients for prediction algorithms in the outcome model |
Estimate |
estimates and standard errors of treatment effects |
Z.hat |
final weighted prediction for the treatment |
Y1.hat |
final weighted prediction for the outcome among treated units |
Y0.hat |
final weighted prediction for the outcome among control units |
Z.hats |
all the predictions for the treatment from prediction algorithms |
Y1.hats |
all the predictions for the outcome among treated units from prediction algorithms |
Y0.hats |
all the predictions for the outcome among control units from prediction algorithms |
# two-level data
DRPRcomb.rlst <- 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)
summary(DRPRcomb.rlst)
# two-level data with default algorithms
DRPRcomb.rlst2 <- DRPRcomb(Y=twolevel_data$Y, Z=twolevel_data$Z, interZ=(~ W1),
X=twolevel_data[, c("X1", "X2", "X3", "W1")], ID=twolevel_data$id,
library=c("glm", "deeplearning"), data=twolevel_data)
summary(DRPRcomb.rlst2)
# cross-classified data with default algorithms
DRPRcomb.rlst3 <- DRPRcomb(Y=crossclassified_data$Y, Z=crossclassified_data$Z, interZ=(~ W1),
X=crossclassified_data[, c("X1", "X2", "X3", "W1", "Q1")], ID=crossclassified_data$f12id,
library=c("glm", "deeplearning"), data=crossclassified_data)
summary(DRPRcomb.rlst3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.