plot_trank: Trace rank plot the estimands of a 'bartCause::bartc()' model

View source: R/plot_trace.R

plot_trankR Documentation

Trace rank plot the estimands of a 'bartCause::bartc()' model

Description

Trace plots may occlude convegence issues within Markov Chains. Trace rank plots present an alternartive convergence diagnostic of MCMC convergence. Trank plots are described in detail in Vehtari et al. (2021).

Usage

plot_trank(.model, type = c("cate", "sate", "pate", "sigma"))

Arguments

.model

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

type

parameter to plot options are average treatment effects: 'cate', 'sate' and 'pate' as well as posterior predicitve uncertainty 'sigma'

Value

ggplot object

Author(s)

George Perrett

References

Vehtari, A., Gelman, A., Simpson, D., Carpenter, B., & Bürkner, P. C. (2021). Rank-normalization, folding, and localization: An improved R ̂ for assessing convergence of MCMC (with discussion). Bayesian analysis, 16(2), 667-718.

Examples


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_trank(.model = model_results)



joemarlo/plotBart documentation built on May 31, 2024, 12:22 p.m.