Package: survextrap 1.0.1

survextrap: 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>.

Authors:Christopher Jackson [aut, cre, cph], Iain Timmins [ctb], Michael Sweeting [ctb]

survextrap_1.0.1.tar.gz
survextrap_1.0.1.zip(r-4.7)survextrap_1.0.1.zip(r-4.6)survextrap_1.0.1.zip(r-4.5)
survextrap_1.0.1.tgz(r-4.6-x86_64)survextrap_1.0.1.tgz(r-4.6-arm64)survextrap_1.0.1.tgz(r-4.5-x86_64)survextrap_1.0.1.tgz(r-4.5-arm64)
survextrap_1.0.1.tar.gz(r-4.7-arm64)survextrap_1.0.1.tar.gz(r-4.7-x86_64)survextrap_1.0.1.tar.gz(r-4.6-arm64)survextrap_1.0.1.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html
card.svg |card.png
survextrap/json (API)
NEWS

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

Bug tracker:https://github.com/chjackson/survextrap/issues

Pkgdown/docs site:https://chjackson.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • cetux - Datasets for evaluation of cetuximab in head and neck cancer
  • cetux_bh - Datasets for evaluation of cetuximab in head and neck cancer
  • cetux_seer - Datasets for evaluation of cetuximab in head and neck cancer
  • colons - Colon cancer survival data
  • curedata - Simulated data for testing mixture cure models

On CRAN:

Conda:

cpp

6.90 score 12 stars 55 scripts 625 downloads 54 exports 51 dependencies

Last updated from:17cbe470c1. Checks:12 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK377
linux-devel-x86_64OK396
source / vignettesOK524
linux-release-arm64OK381
linux-release-x86_64OK423
macos-release-arm64OK225
macos-release-x86_64OK613
macos-oldrel-arm64OK375
macos-oldrel-x86_64OK521
windows-develOK442
windows-releaseOK411
windows-oldrelOK391
wasm-releaseFAIL186

Exports:cumhazdsurvmsplinedsurvmspline_waneget_drawshazardhazard_ratiohrtimehsurvmsplineHsurvmsplinehsurvmspline_waneHsurvmspline_waneirmstmean_survmsplinemean_survmspline_wanemspline_basismspline_constant_coefsmspline_initmspline_list_initmspline_plotdatamspline_plotsetupmspline_specmsplinemodel_initp_betap_gammap_hrp_meansurvp_normalp_tplot_hazardplot_hazard_ratioplot_msplineplot_prior_hazardplot_survivalprint_priorsprior_haz_constprior_haz_sdprior_hrprior_hr_sdprior_predprior_sampleprior_sample_hazardpsurvmsplinepsurvmspline_waneqsurvmsplineqsurvmspline_wanermstrmst_survmsplinermst_survmspline_wanersurvmsplinersurvmspline_wanestandardise_tostandardize_tosurvextrapsurvival

Dependencies:abindbackportsBHcallrcheckmateclicpp11descdistributionalfarvergenericsggplot2gluegridExtragtableinlineisobandlabelinglatticelifecycleloomagrittrMatrixmatrixStatsnumDerivpillarpkgbuildpkgconfigposteriorprocessxpsQuickJSRR6RColorBrewerRcppRcppArmadilloRcppEigenRcppParallelrlangrstanS7scalessplines2StanHeaderssurvivaltensorAtibbleutf8vctrsviridisLitewithr

Details of methods behind survextrap

Rendered frommethods.Rmdusingknitr::rmarkdownon May 09 2026.

Last update: 2026-01-12
Started: 2022-06-30

Examples of using survextrap

Rendered fromexamples.Rmdusingknitr::rmarkdownon May 09 2026.

Last update: 2026-02-18
Started: 2022-06-30

Priors in survextrap models

Rendered frompriors.Rmdusingknitr::rmarkdownon May 09 2026.

Last update: 2026-01-11
Started: 2023-03-30

Readme and manuals

Help Manual

Help pageTopics
The 'survextrap' package.survextrap-package
Datasets for evaluation of cetuximab in head and neck cancercetux cetux_bh cetux_seer
Colon cancer survival datacolons
Estimates of cumulative hazard from a survextrap modelcumhaz
Simulated data for testing mixture cure modelscuredata
Posterior draws from a survextrap modelget_draws
Estimates of hazard from a 'survextrap' modelhazard
Hazard ratio against time in a survextrap modelhazard_ratio
Hazard ratio between high and low values of the hazard over timehrtime
Incremental restricted mean survival timeirmst
Mean survival timemean.survextrap
Evaluate an M-spline basis matrix at the specified times.mspline_basis
Determine M-spline basis coefficients which give a constant function.mspline_constant_coefs
Create a default M-spline model structuremspline_init
Validate an M-spline object supplied as a list, choosing defaults if needed.mspline_list_init
Data for plotting an M-spline function, showing how it is built up from its basismspline_plotdata
Get basis for an illustration of an M-spline with given knots.mspline_plotsetup
Make default M-spline knot specification given a survival dataset.mspline_spec
Create an M-spline survival model, both structure and parameters.msplinemodel_init
Derive a normal prior for the log hazard ratio parameter based on a guess at the hazard ratiop_hr
Derive a normal prior for the log hazard scale parameter based on a guess at survival timesp_meansurv
Plot hazard curves from a survextrap modelplot_hazard
Plot hazard ratio against time from a survextrap modelplot_hazard_ratio
Plot a M-spline function, showing how it is built up from its basisplot_mspline
Plot survival curves from a survextrap modelplot_survival
Plot method for survextrap model objectsplot.survextrap
Print the priors used in a fitted survextrap modelprint_priors
Print a fitted survextrap modelprint.survextrap
Determine priors for time-varying hazards and hazard ratiosprior_haz prior_haz_sd prior_hr_sd
Summarises the prior for the constant hazard implied by a particular prior on the hazard scale parameter and spline specification.prior_haz_const
Summarises the prior for the hazard ratio implied by a particular prior on the log hazard ratioprior_hr
Simulate a dataset from the prior predictive distribution of survival times in an M-spline survival model.prior_pred
Sample from the joint prior of parameters in a survextrap modelprior_sample
Generate and/or plot a sample from the prior distribution of M-spline hazard curvesplot_prior_hazard prior_sample_hazard
Prior distributions and optionspriors p_beta p_gamma p_normal p_t
Restricted mean survival timermst
Constructor for a standardising population used for survextrap outputsstandardise_to standardize_to
Posterior summary statistics for parameters of survextrap modelssummary.survextrap
Flexible Bayesian parametric survival modelssurvextrap
Estimates of survival from a 'survextrap' modelsurvival
M-spline survival distributiondsurvmspline Hsurvmspline hsurvmspline mean_survmspline psurvmspline qsurvmspline rmst_survmspline rsurvmspline Survmspline
M-spline survival distribution under treatment effect waningdsurvmspline_wane Hsurvmspline_wane hsurvmspline_wane mean_survmspline_wane psurvmspline_wane qsurvmspline_wane rmst_survmspline_wane rsurvmspline_wane Survmspline_wane