Learn R Programming

blendR: An R package for blending survival curves

The goal of blendR is to blend two survival curves together from one to the other according to some defined blending function. Originally developed for the following paper

Che Z, Green N, Baio G. Blended Survival Curves: A New Approach to Extrapolation for Time-to-Event Outcomes from Clinical Trials in Health Technology Assessment. Med Decis Mak. 2022;43(3):299–310.

Installation

You can install the development version of blendR from GitHub with:

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

Example

This is a basic example which shows you how to solve a common problem. Using the TA174_FCR data set contained in the blendR package, we fit exponential distribution survival models with no covariates with the fit.models() function from the survHE package. This employs the HMC sampler from Stan behind the scenes. The external or long-term data are obtained from an heuristic approach to simulating data consistent with user-defined constraints. The results are then blended into a single survival curve using the blendsurv() function.

library(blendR)
library(survHE)

## trial data
data("TA174_FCR", package = "blendR")

## externally estimated data
data_sim <- ext_surv_sim(t_info = 144,
                         S_info = 0.05,
                         T_max = 180)
                         
obs_Surv <- fit.models(formula = Surv(death_t, death) ~ 1,
                        data = dat_FCR,
                        distr = "exponential",
                        method = "hmc")
                        
ext_Surv <- fit.models(formula = Surv(time, event) ~ 1,
                       data = data_sim,
                       distr = "exponential",
                       method = "hmc")
                       
blend_interv <- list(min = 48, max = 150)
beta_params <- list(alpha = 3, beta = 3)

ble_Surv <- blendsurv(obs_Surv, ext_Surv, blend_interv, beta_params)

plot(ble_Surv)

GitHub Site

https://statisticshealtheconomics.github.io/blendR/

Licence

Contributing

Please submit contributions through Pull Requests, following the contributing guidelines.

To report issues and/or seek support, please file a new ticket in the issue tracker.

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

Copy Link

Version

Install

install.packages('blendR')

Monthly Downloads

132

Version

1.0.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Zhaojing Che

Last Published

September 3rd, 2025

Functions in blendR (1.0.0)

blendsurv

Blended survival object
dat_FCR

Survival data
make_surv_methods

Create survival probabilities
ext_surv_sim

Create an external survival data based on expert opinion
weightplot

Plots the weights for the blending procedure
plot.blended

Blended survival curve based on short-term data and external information
fit_inla_pw

Generate survival estimates with a piecewise exponential Cox model (using INLA)
manip_plot

Blended survival plot with manipulate
data_times

Get event time data