R package to make potential outcomes based causal inference easier
plotBart is a diagnostic and plotting package for
thinkCausal. It’s designed to expedite the causal inference analysis process. It includes functions to assist in diagnostics and plotting.
library(plotBart) data(lalonde) confounders <- c('age', 'educ', 'black', 'hisp', 'married', 'nodegr') # fit BART model model_results <- bartCause::bartc( response = lalonde[['re78']], treatment = lalonde[['treat']], confounders = as.matrix(lalonde[, confounders]), estimand = 'ate', commonSup.rule = 'none', verbose = FALSE, keepTrees = TRUE ) # plot common support plot_common_support(.model = model_results)
# plot CATE and manipulate ggplot object plot_CATE( .model = model_results, type = 'density', ci_80 = TRUE, ci_95 = TRUE, .mean = TRUE ) + labs(subtitle = 'My comments on the results') + theme_classic()
plotBart is currently in development and is available to test by installing via:
# latest release on CRAN install.packages('plotBart') # latest development version # install.packages("remotes") remotes::install_github('priism-center/plotBart)
Find the code here: github.com/priism-center/plotBart