library(rpart)
library(htetree)
hte_causalTree(outcomevariable="outcome",
data=data.frame("confounder"=c(0, 1, 1, 0, 1, 1),
"treatment"=c(0,0,0,1,1,1),
"prop_score"=c(0.4, 0.4, 0.5, 0.6, 0.6, 0.7),
"outcome"=c(1, 2, 2, 1, 4, 4)),
treatment_indicator = "treatment",
ps_indicator = "prop_score",
covariates = "confounder")
Run the code above in your browser using DataLab