ce_estimate {CIMTx}R Documentation

Causal inference with multiple treatments using observational data

Description

The function ce_estimate implements the 6 different methods for causal inference with multiple treatments using observational data.

Usage

ce_estimate(
  y,
  x,
  w,
  method,
  formula = NULL,
  discard = FALSE,
  estimand,
  trim_perc = NULL,
  SL.library,
  reference_trt,
  boot = FALSE,
  nboots,
  verbose_boot = TRUE,
  ndpost = 1000,
  caliper = 0.25,
  n_cluster = 5,
  ...
)

Arguments

y

A numeric vector (0, 1) representing a binary outcome.

x

A dataframe, including all the covariates but not treatments.

w

A numeric vector representing the treatment groups.

method

A character string. Users can selected from the following methods including "RA", "VM", "BART", "TMLE", "IPTW-Multinomial", "IPTW-GBM", "IPTW-SL", "RAMS-Multinomial", "RAMS-GBM", "RAMS-SL".

formula

A formula object representing the variables used for the analysis. The default is to use all terms specified in x.

discard

A logical indicating whether to use the discarding rules for the BART based methods. The default is FALSE.

estimand

A character string representing the type of causal estimand. Only "ATT" or "ATE" is allowed. When the estimand = "ATT", users also need to specify the reference treatment group by setting the reference_trt argument.

trim_perc

A numeric value indicating the percentile at which the inverse probability of treatment weights should be trimmed. The default is NULL.

SL.library

A character vector of prediction algorithms. A list of functions included in the SuperLearner package can be found with listWrappers.

reference_trt

A numeric value indicating reference treatment group for ATT effect.

boot

A logical indicating whether or not to use nonparametric bootstrap to calculate the 95% confidence intervals of the causal effect estimates. The default is FALSE.

nboots

A numeric value representing the number of bootstrap samples.

verbose_boot

A logical value indicating whether to print the progress of nonparametric bootstrap. The default is TRUE.

ndpost

A numeric value indicating the number of posterior draws for the Bayesian methods ("BART" and "RA").

caliper

A numeric value denoting the caliper which should be used when matching (method = "VM") on the logit of GPS within each cluster formed by K-means clustering. The caliper is in standardized units. For example, caliper = 0.25 means that all matches greater than 0.25 standard deviations of the logit of GPS are dropped. The default value is 0.25.

n_cluster

A numeric value denoting the number of clusters to form using K means clustering on the logit of GPS when method = "VM". The default value is 5.

...

Other parameters that can be passed through to functions.

Value

A list of causal estimands including risk difference (RD), odds ratios (OR) and relative risk (RR) between different treatment groups.

References

Hu, L., Gu, C., Lopez, M., Ji, J., & Wisnivesky, J. (2020). Estimation of causal effects of multiple treatments in observational studies with a binary outcome. Statistical Methods in Medical Research, 29(11), 3218–3234.

Hu, L., Gu, C. Estimation of causal effects of multiple treatments in healthcare database studies with rare outcomes. Health Service Outcomes Research Method 21, 287–308 (2021).

Examples

lp_w_all <-
 c(".4*x1 + .1*x2  - .1*x4 + .1*x5",    # w = 1
   ".2 * x1 + .2 * x2  - .2 * x4 - .3 * x5")  # w = 2
nlp_w_all <-
 c("-.5*x1*x4  - .1*x2*x5", # w = 1
   "-.3*x1*x4 + .2*x2*x5")# w = 2
lp_y_all <- rep(".2*x1 + .3*x2 - .1*x3 - .1*x4 - .2*x5", 3)
nlp_y_all <- rep(".7*x1*x1  - .1*x2*x3", 3)
X_all <- c(
 "rnorm(300, 0, 0.5)",# x1
 "rbeta(300, 2, .4)",   # x2
 "runif(300, 0, 0.5)",# x3
 "rweibull(300,1,2)",  # x4
 "rbinom(300, 1, .4)"# x5
)
set.seed(111111)
data <- data_sim(
 sample_size = 300,
 n_trt = 3,
 X = X_all,
 lp_y = lp_y_all,
 nlp_y  = nlp_y_all,
 align = FALSE,
 lp_w = lp_w_all,
 nlp_w = nlp_w_all,
 tau = c(-1.5,0,1.5),
 delta = c(0.5,0.5),
 psi = 1
)
ce_estimate(y = data$y, x = data$covariates, w = data$w,
ndpost=100, method = "RA", estimand = "ATE")

[Package CIMTx version 1.1.0 Index]