Learn R Programming

blendR (version 1.0.0)

plot.blended: Blended survival curve based on short-term data and external information

Description

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

Usage

# S3 method for blended
plot(x, alpha = c(0.1, 0.05), ...)

Value

A ggplot2 object

Arguments

x

A blended survival curve object obtain from blendsurv()

alpha

A vector specifying the opacity of ribbon for the blended curve and other curves

...

Additional arguments

See Also

blendsurv()

Examples

Run this code
if (FALSE) { # rlang::is_installed("survHEhmc")
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)
}

Run the code above in your browser using DataLab