Learn R Programming

plotBart (version 0.1.7)

plot_trace: Trace plot the estimands of a `bartCause::bartc()` model

Description

Returns a ggplot of the estimated effect over each iteration of the model fit. This is used to visually assess the convergence of Markov chain Monte Carlo (MCMC) sampling. Chains should be well mixed such that no single color is notably separate from others.

Usage

plot_trace(.model)

Arguments

.model

a model produced by `bartCause::bartc()`

Value

ggplot object

Examples

Run this code
# NOT RUN {
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',
 commonSup.rule = 'none'
)
plot_trace(.model = model_results)
# }

Run the code above in your browser using DataLab