Plot a regression tree predicting variables with lack of overlap
Source:R/plot_common_support.R
plot_predicted_common_support.Rd
Identify variables that predict lack of overlap
Usage
plot_predicted_common_support(
.model,
max_depth = 3,
rule = c("both", "sd", "chi")
)
Arguments
- .model
a model produced by `bartCause::bartc()`
- max_depth
a number indicatin the max depth of the tree. Higher numbers are more prone to overfitting.
- rule
one of c('both', 'sd', 'chi') denoting which rule to use to identify lack of support
Examples
# \donttest{
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'
)
#> fitting treatment model via method 'bart'
#> fitting response model via method 'bart'
plot_predicted_common_support (model_results)
#> no cases were removed under the standard deviation or chi-squared rules
#> NULL
plot_predicted_common_support (model_results, max_depth = 2, rule = 'chi')
#> no cases were removed under the chi squared rule
#> NULL
# }