View source: R/plot_moderators.R
plot_moderator_c_loess | R Documentation |
Plot the LOESS prediction of ICATEs by a continuous covariate. This is an alternative to partial dependency plots to assess treatment effect heterogeneity by a continuous covariate. See Carnegie, Dorie and Hill 2019.
plot_moderator_c_loess(.model, moderator, line_color = "blue")
.model |
a model produced by 'bartCause::bartc()' |
moderator |
the moderator as a vector |
line_color |
the color of the loess line |
ggplot object
George Perrett, Joseph Marlo
Carnegie, N., Dorie, V., & Hill, J. L. (2019). Examining treatment effect heterogeneity using BART. Observational Studies, 5(2), 52-70.
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_c_loess(model_results, lalonde$age)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.