View source: R/plot_moderators.R
plot_moderator_search | R Documentation |
Plot a single regression tree for exploratory heterogeneous effects. Fit single regression tree on bartc() ICATEs to produce variable importance plot. This plot is useful for identifying potential moderating variables. Tree depth may be set to depths 1, 2 or 3. Terminal nodes signal the Conditional Average Treatment effect within levels of moderation variables. Trees with different values across terminal nodes suggest strong treatment effect moderation.
plot_moderator_search(.model, max_depth = c(2, 1, 3))
.model |
a model produced by 'bartCause::bartc()' |
max_depth |
one of c(1, 2, 3). Maximum number of node levels within the tree. 2 is recommended |
ggplot object
George Perrett, Joseph Marlo
data(lalonde)
confounders <- c('age', 'educ', 'black', 'hisp', 'married', 'nodegr')
model_results <- bartCause::bartc(
response = lalonde[['re78']],
treatment = lalonde[['treat']],
confounders = as.matrix(lalonde[, confounders]),
estimand = 'ate',
commonSuprule = 'none'
)
plot_moderator_search(model_results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.