  In longitudinal observational studies with a time-to-event outcome, a common
objective in causal analysis is to estimate the causal survival curve under
hypothetical intervention scenarios within the study cohort. The g-formula is a
particularly useful tool for this analysis. To enhance the traditional
parametric g-formula approach, we developed a more adaptable Bayesian g-formula
estimator, which incorporates the Bayesian additive regression trees (BART) in
the modeling of the time-evolving generative components, aiming to mitigate
bias due to model misspecification. Specifically, we introduce a more general
class of g-formulas for discrete survival data that can incorporate the
longitudinal balancing scores, which serve as an effective method for dimension
reduction and are vital when dealing with an expanding array of time-varying
confounders. The minimum sufficient formulation of these longitudinal balancing
scores is linked to the nature of treatment regimes, whether static or dynamic.
For each type of treatment regime, we provide posterior sampling algorithms
grounded in the BART framework. We have conducted simulation studies to
illustrate the empirical performance of the proposed method and further
demonstrate its practical utility using data from the Yale New Haven Health
System's (YNHHS) electronic health records.
