[Paper Review] Bayesian Survival Analysis Using the rstanarm R Package
This paper describes how the rstanarm R package can fit a wide range of Bayesian survival models, including hazard-based and AFT formulations, with full back-end estimation via Stan.
Survival data is encountered in a range of disciplines, most notably health and medical research. Although Bayesian approaches to the analysis of survival data can provide a number of benefits, they are less widely used than classical (e.g. likelihood-based) approaches. This may be in part due to a relative absence of user-friendly implementations of Bayesian survival models. In this article we describe how the rstanarm R package can be used to fit a wide range of Bayesian survival models. The rstanarm package facilitates Bayesian regression modelling by providing a user-friendly interface (users specify their model using customary R formula syntax and data frames) and using the Stan software (a C++ library for Bayesian inference) for the back-end estimation. The suite of models that can be estimated using rstanarm is broad and includes generalised linear models (GLMs), generalised linear mixed models (GLMMs), generalised additive models (GAMs) and more. In this article we focus only on the survival modelling functionality. This includes standard parametric (exponential, Weibull, Gompertz) and flexible parametric (spline-based) hazard models, as well as standard parametric accelerated failure time (AFT) models. All types of censoring (left, right, interval) are allowed, as is delayed entry (left truncation), time-varying covariates, time-varying effects, and frailty effects. We demonstrate the functionality through worked examples. We anticipate these implementations will increase the uptake of Bayesian survival analysis in applied research.
Motivation & Objective
- Motivate Bayesian survival analysis and highlight benefits over traditional methods.
- Describe the modelling frameworks for survival data within rstanarm, including hazard-scale and AFT formulations.
- Explain estimation, priors, and handling of censoring, delayed entry, and time-varying effects.
- Show practical implementation details and how to use rstanarm for survival analyses in applied research.
Proposed method
- Present hazard-scale models with baseline hazards modeled by exponential, Weibull, Gompertz, M-splines, and B-splines.
- Present AFT models with baseline survival specified via exponential or Weibull and time-varying covariate effects.
- Allow time-varying coefficients modeled with B-splines or piecewise constant functions.
- Incorporate time-invariant and time-varying covariates, frailty, and multilevel clustering with random effects.
- Provide log-posterior and log-likelihood formulations for censored data (left, right, interval, delayed entry) and describe numerical integration via Gauss-Kronrod quadrature when needed.
- Detail prior choices for intercepts, regression coefficients, auxiliary parameters, and covariance structures.
Experimental results
Research questions
- RQ1How can Bayesian survival models be specified and estimated using the rstanarm package?
- RQ2What survival model families (hazard-based and AFT) does rstanarm support, and how are time-varying effects and censoring handled?
- RQ3What priors and multilevel structures are available for Bayesian survival analysis in rstanarm?
- RQ4How does rstanarm perform estimation (full Bayesian via HMC/NUTS) and what are the computational approaches for integral evaluation?
Key findings
- The paper demonstrates that rstanarm supports a broad suite of survival models, including parametric and flexible baseline hazards with time-varying effects.
- It handles all censoring types (left, right, interval) and delayed entry, as well as frailty and multilevel clustering.
- It provides both hazard-scale and AFT formulations, with clear mappings between hazard ratios and acceleration factors depending on the model.
- Time-varying effects are modeled using B-splines or piecewise constants, enabling non-proportional hazards or non-constant acceleration.
- Estimation is performed with full Bayesian inference via Stan, using NUTS, with options for priors that affect regularization and interpretability.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.