The goal of rstanbmcm is to jointly model two event time distributions (e.g. time to disease progression and time to death) within a Bayesian relative survival mixture cure model framework, using the Stan engine called from R.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("StatisticsHealthEconomics/rstanbmcm")

Motivation

Mixture cure models are increasingly popular in health problems and in particular in oncology. A Bayesian paradigm allows the explicitly incorporation of uncertainties and principled synthesis of prior knowledge such as via expert elicitation or previous trials. By extending current methods to account for the dependence between event times we leverage additional information to make better inferences and decisions.

Data

  • data/surv_input_data.RData: Individual-level patient data. This is cleaned data from the previous frequentist n8thangreen/mixture_cure_model package. The fields are:
    • OSage: age at OS event
    • PFSage: age at PFS event
    • os: time of OS
    • os_event: censoring indicator
    • pfs: time of PFS
    • pfs_event: censoring indicator
    • TRTA: treatment name
    • SEX: male or female
    • COUNTRY: abbreviated
    • ACOUNTRY: full name
    • PFS_rate: background mortality at time of PFS event from life tables
    • OS_rate: background mortality at time of OS event from life tables

Workflow

The Stan engine can be called either with the compile C code or with the Stan script without precompiling.

  • The precompiled Stan code is in inst/stan and the compiled code in src/
  • The non-compiled Stan code is in scripts/

There are two runner scripts:

  • scripts/stan_checkmate.R: Run Stan mixture cure model with separate model for PFS and OS data.
  • scripts/stan_checkmate_joint.R: Run Stan mixture cure model with joint model for PFS and OS data.

Output

Because the Stan output files are large, we do not save a single list of all model outputs as a single objects. Instead stan_filenames.RData is a list of file names of the model outputs and each output is saved in a separate file. The file name formats are:

  • For the separate OS, PFS models: stan_<distn>_<event type>_<treatment name>.Rds
  • For the joint OS, PFS models: stan_<distn>_<distn>_<treatment name>.Rds

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.