Learn R Programming

CIMTx (version 0.3.0)

iptw_multiTrt_ate: Inverse probability of treatment weighting for ATE estimation (IPTW)

Description

This function implements the IPTW method when estimand is ATE. Please use our main function causal_multi_treat.R.

Usage

iptw_multiTrt_ate(y, trt_ind, psdat, method, trim_alpha, SL.library)

Arguments

y

numeric vector for the binary outcome

trt_ind

numeric vector for the treatment indicator

psdat

data frame containing the treatment indicator and covariates

method

methods for causal inference with multiple treatments, inherited from causal_multi_treat.R

trim_alpha

alpha values for IPTW weight trimming, inherited from causal_multi_treat.R

SL.library

methods specified with SL.library in Superlearner package, inherited from causal_multi_treat.R

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(1)
idata = data_gen(n = 50, ratio =1,scenario = 1)
trt_ind <- as.numeric(idata$trtdat$trt_ind)
all_vars <- idata$trtdat[, -1] #exclude treatment indicator
y <- idata$Yobs
iptw_multiTrt_ate(y=y, trt = trt_ind,SL.library = c("SL.glm"),
trim_alpha = 0.05, method = "IPTW-Logistics-Trim")
causal_multi_treat(y = y,trt = trt_ind,
method = "IPTW-Logistics", estimand = "ATE")

# }

Run the code above in your browser using DataLab