MyNixOS website logo
Description

Bayesian Flexible Parametric Survival Modelling and Extrapolation.

Survival analysis using a flexible Bayesian model for individual-level right-censored data, optionally combined with aggregate data on counts of survivors in different periods of time. An M-spline is used to describe the hazard function, with a prior on the coefficients that controls over-fitting. Proportional hazards or flexible non-proportional hazards models can be used to relate survival to predictors. Additive hazards (relative survival) models, waning treatment effects, and mixture cure models are also supported. Priors can be customised and calibrated to substantive beliefs. Posterior distributions are estimated using 'Stan', and outputs are arranged in a tidy format. See Jackson (2023) <doi:10.1186/s12874-023-02094-1>.

survextrap

survextrap is an R package for parametric survival modelling with either or both of:

  1. A standard individual-level, right-censored survival dataset, e.g.
Survival timeDeathPredictors...
2 years Yes
5 years No
etc...
  1. (optionally) "External" data sources in the following aggregate "count" form:
Follow-up period NumberPredictors...
Start time $t$End time $u$Alive at $t$Still alive at $u$
$t_{1}$ $u_{1}$ $n_{1}$ $r_{1}$
$t_{2}$ $u_{2}$ $n_{2}$ $r_{2}$
etc...

Any number of rows can be supplied for the "external" data, and the time intervals do not have to be distinct or exhaustive.

Many forms of external data that might be useful for survival extrapolation (such as population data, registry data or elicited judgements) can be manipulated into this common "count" form.

Principles

  • Extrapolations from short-term individual level data should be done using explicit data or judgements about how risk will change over time.

  • Extrapolations should not rely on standard parametric forms (e.g. Weibull, log-normal, gamma...) that are only used out of convention and do not have interpretations as plausible mechanisms for how risk will change over time.

  • Instead of selecting (or averaging) traditional parametric models, an arbitrarily flexible parametric model should be used, that adapts to give the optimal fit to the short-term and long-term data in combination.

How it works

  • Bayesian multiparameter evidence synthesis is used to jointly model all sources of data and judgements.

  • An M-spline is used to represent how the hazard changes through time (as in rstanarm). The Bayesian fitting method automatically chooses the optimal level of smoothness and flexibility. Spline "knots" should span the period covered by the data, and any future period where there is a chance that the hazard may vary. Then if there is no data in the future period, the uncertainty will be acknowledged and the predicted hazards will have wide credible intervals.

  • A proportional hazards model or a flexible non-proportional hazards model can be used to describe the relation of survival to predictors.

  • Mixture cure, relative survival and treatment effect waning models are supported.

  • It has an R interface, designed to be friendly to those familiar with standard R modelling functions.

  • Stan is used under the surface to do MCMC (Hamiltonian Monte Carlo) sampling from the posterior distribution, in a similar fashion to rstanarm and survHE.

  • Estimates and posterior summaries and samples for outputs, such as survival, hazard and (restricted) mean survival, can easily be extracted.

Technical details of the methods

The model is fully described in a paper: Jackson, BMC Medical Research Methodology (2023). See also vignette("methods").

vignette("priors") goes into detail on how prior distributions and judgements can be specified in survextrap - an important but often-neglected part of Bayesian analysis.

Examples of how to use it

vignette("examples") gives a rapid tour of each feature, using simple textbook examples and simulated data.

The cetuximab case study is a more in-depth demonstration of how survextrap could be used in a typical health technology evaluation, based on clinical trial, disease registry, general population and elicited data. This vignette accompanies Section 4 of the preprint paper.

Slides from presentations about survextrap

Installation

The current version can be installed as:

install.packages("survextrap", repos=c('https://chjackson.r-universe.dev',
                                       'https://cloud.r-project.org'))

and will soon be on CRAN as well.

Please give feedback and suggestions if you use it. These can be posted on github issues, or email.

R-CMD-check test-coverage

Metadata

Version

1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows