Learn R Programming

CIMTx (version 0.3.0)

causal_multi_treat: Estimation of causal effects of multiple treatments

Description

This function estimates the causal effects of multiple treatments with a binary outcome.

Usage

causal_multi_treat(
  y,
  x,
  trt,
  method,
  discard = "No",
  estimand,
  trim_alpha = 0.05,
  SL.library = c("SL.glm", "SL.gam", "SL.knn"),
  reference_trt = 1,
  ndpost = 1000
)

Arguments

y

numeric vector for the binary outcome

x

dataframe including the treatment indicator and the covariates

trt

numeric vector for the treatment indicator

method

methods for causal inference with multiple treatments. Please select one of the following methods:

  1. Regression Adjustment: Logistics regression to impute missing outcomes

  2. VM Matching: vector matching

  3. BART: Bayesian Additive Regression Trees

  4. TMLE: Targeted maximum likelihood

  5. IPTW-Logistics: Inverse probability of treatment weighting (IPTW) with weights from logistics regression

  6. IPTW-Logistics-Trim: IPTW with trimmed weights from logistics regression

  7. IPTW-GBM: IPTW with weights from generalized boosted method

  8. IPTW-GBM-Trim: IPTW with trimmed weights from generalized boosted method

  9. IPTW-Superlearner: IPTW with weights from superlearner

  10. IPTW-Superlearner-Trim: IPTW with trimmed weights from superlearner

discard

discarding rules for BART method. Please select "No", "Lenient" or "Stringent". The default is "No".

estimand

causal estimands. Please select "ATT" or "ATE"

trim_alpha

alpha values for IPTW weight trimming. The default is 0.05, which means we truncate upper 95% and lower 5% of the weights for further IPTW estimation. The default is a combination of SL.glm, SL.gam and SL.knn.

SL.library

methods specified with SL.library in Superlearner package

reference_trt

Reference group for ATT

ndpost

number of independent simulation draws to create

Value

list with 2 elements for ATT effect. It contains

ATT12:

A dataframe containing the estimation, standard error, lower and upper 95% CI for RD/RR/OR

ATT13:

A dataframe containing the estimation, standard error, lower and upper 95% CI for RD/RR/OR

list with 3 elements for ATE effect. It contains
ATE12:

A dataframe containing the estimation, standard error, lower and upper 95% CI for RD/RR/OR

ATE13:

A dataframe containing the estimation, standard error, lower and upper 95% CI for RD/RR/OR

ATE23:

A dataframe containing the estimation, standard error, lower and upper 95% CI for RD/RR/OR

Examples

Run this code
# NOT RUN {
library(CIMTx)
set.seed(3242019)
idata = data_gen(n = 12, ratio =1,scenario = 1)
trt_ind <- as.numeric(idata$trtdat$trt_ind)
all_vars <- idata$trtdat[, -1] #exclude treatment indicator
y <- idata$Yobs

# Regression Adjustment
causal_multi_treat(y = y, x = idata$trtdat,ndpost = 10,
trt = trt_ind, method ="Regression Adjustment", estimand = "ATT", reference_trt = 3)
causal_multi_treat(y = y, x = idata$trtdat,ndpost = 10,
trt = trt_ind, method ="Regression Adjustment",
estimand = "ATE")



# BART with and without discarding
# }
# NOT RUN {
causal_multi_treat(y = y, x = idata$trtdat,
trt = trt_ind, method = "BART", estimand = "ATE", discard = "No")
causal_multi_treat(y = y, x = idata$trtdat,
trt = trt_ind, method = "BART", estimand = "ATE", discard = "No")
causal_multi_treat(y = y, x = idata$trtdat,
trt = trt_ind, method = "BART", estimand = "ATT", discard = "Stringent")
causal_multi_treat(y = y, x = idata$trtdat,
trt = trt_ind, method = "BART", estimand = "ATT", discard = "Stringent")
causal_multi_treat(y = y, x = idata$trtdat,
trt = trt_ind, method = "BART", estimand = "ATT", discard = "Lenient")
causal_multi_treat(y = y, x = idata$trtdat,
trt = trt_ind, method = "BART", estimand = "ATT", discard = "Lenient")

# VM Matching
causal_multi_treat(y = y, x = idata$trtdat,
trt = trt_ind,method = "VM Matching", estimand = "ATT")

# IPTW-related methods
causal_multi_treat(y = y,trt = trt_ind,
method = "IPTW-Logistics", estimand = "ATT")
causal_multi_treat(y = y,trt = trt_ind,
method = "IPTW-Logistics", estimand = "ATE")
causal_multiple_treatment(y = y, x = idata$trtdat,
trt = trt_ind, method = "IPTW-GBM", estimand = "ATE")
causal_multiple_treatment(y = y, x = idata$trtdat,
trt = trt_ind, method = "IPTW-GBM-Trim", estimand = "ATE")
causal_multiple_treatment(y = y, x = idata$trtdat,
trt = trt_ind, method = "IPTW-Superlearner", estimand = "ATE")
causal_multiple_treatment(y = y, x = idata$trtdat,
trt = trt_ind, method = "IPTW-Superlearner-Trim", estimand = "ATE")
causal_multiple_treatment(y = y, x = idata$trtdat,
trt = trt_ind,method = "IPTW-Superlearner", estimand = "ATT")
causal_multiple_treatment(y = y, x = idata$trtdat,
trt = trt_ind, method = "IPTW-Superlearner-Trim", estimand = "ATT")

# }

Run the code above in your browser using DataLab