Learn R Programming

survHE

Survival analysis in health economic evaluation

Contains a suite of functions to systematise the workflow involving survival analysis in health economic evaluation. survHE can fit a large range of survival models using both a frequentist approach (by calling the R package flexsurv) and a Bayesian perspective. For a selected range of models, both Integrated Nested Laplace Integration (via the R package INLA) and Hamiltonian Monte Carlo (via the R package rstan) are possible. HMC models are pre-compiled so that they can run in a very efficient and fast way. In addition to model fitting, survHE provides a set of specialised functions, for example to perform Probabilistic Sensitivity Analysis, export the results of the modelling to a spreadsheet, plotting survival curves and uncertainty around the mean estimates.

NB: To run the Bayesian models, as of version 2.0 of survHE, it is necessary to install the additional packages survHEinla and/or survHEhmc, which are available from this GitHub repository. The reason for this structural change is that in this way, the basic backbone of survHE (available from this main branch of the repo) becomes a very lean package, whose installation is very quick. More details here. All the functionalities are in place for survHE to easily extend to the Bayesian versions, once one or both of the additional "modules" is also installed.

Installation

The most updated version can be installed using the following code.

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

To run the Bayesian versions of the models, you also need to install the ancillary packages

# Bayesian models using HMC/Stan
install.packages(
   "survHEhmc", 
   repos = c("https://giabaio.r-universe.dev", "https://cloud.r-project.org"),
   dependencies=TRUE
)

# Bayesian models using INLA
install.packages(
   "survHEinla", 
   repos = c(
      "https://giabaio.r-universe.dev", 
      "https://cloud.r-project.org",
      "https://inla.r-inla-download.org/R/stable"
   ),
   dependencies=TRUE
)

(these two are optional, in some sense, so you don't have to, unless you want to do the right thing and be Bayesian about it... :wink:)

Copy Link

Version

Install

install.packages('survHE')

Monthly Downloads

720

Version

2.0.5

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Gianluca Baio

Last Published

June 12th, 2025

Functions in survHE (2.0.5)

ta174

NICE TA174 dataset.
psa.plot

Graphical depiction of the probabilistic sensitivity analysis for the survival curves
summary.survHE

Prints a summary table for the distribution the mean survival time for a given model and data
markov_trace

Markov trace
make_data_multi_state

make_data_multi_state
model.fit.plot

Graphical representation of the measures of model fitting based on Information Criteria
theme_survHE

A Custom ggplot2 Theme for Survival Plots
data

A fictional survival trial.
survHE-package

survHE: Survival Analysis in Health Economic Evaluation
print.survHE

Print a summary of the survival model(s) fitted by fit.models
three_state_mm

three_state_mm
plot.survHE

Plot survival curves for the models fitted using fit.models
fit.models

Fit parametric survival analysis for health economic evaluations
make_newdata

Creates a 'newdata' list to modify the plots for specific individual profiles (with respect to the covariates)
make.transition.probs

make.transition.probs
plot_transformed_km

Plot to assess suitability of parametric model
msmdata

NICE TA174 dataset in multi-state format.
make.surv

Engine for Probabilistic Sensitivity Analysis on the survival curves
digitise

Format digitised data for use in survival analysis
make.ipd

Create an individual level dataset from digitised data
write.surv

write.surv