Abstract
While randomized trials are the gold standard in causal inference, observational studies are often conducted when trials are infeasible either due to logistical or ethical constraints. Since treatments are not randomized in observational studies, techniques from causal inference are required to adjust for confounding. Bayesian approaches to causal estimation are desirable because they provide: 1) prior smoothing that offers useful regularization of causal effect estimates, 2) flexible models that are robust to misspecification, and 3) full inference (i.e., both point estimates and uncertainty quantification) for causal estimands. However, Bayesian causal inference is difficult to implement manually and there is a lack of user-friendly software, presenting a significant barrier to wide-spread use. Moreover, there is a lack of manuscripts aimed at explicitly connecting statistical/causal formula with implementation code. We address this gap by developing and describing causalBETA (BayesianEventTimeAnalysis) - an open-source R package for estimating causal effects on event-time outcomes using Bayesian semiparametric models. The package provides a familiar front-end to users, with syntax identical to existing survival analysis R packages, while leveraging Stan - a popular platform for high performance Bayesian computing - for efficient posterior computation. To improve user experience, the package provides custom S3 class objects and methods to facilitate visualizations and summaries of results using familiar generic functions like plot() and summary(). In this paper, we provide the methodological details of the package, a demonstration using publicly available data, and computational guidance.