Skip to contents

Define a survival distribution based on explicit survival probabilities

Usage

define_surv_table(x)

# S3 method for class 'data.frame'
define_surv_table(x)

# S3 method for class 'character'
define_surv_table(x)

Arguments

x

a data frame with columns time and survival

Value

a surv_table object, which can be used with compute_surv().

Examples

 x <- data.frame(time = c(0, 1, 5, 10), survival = c(1, 0.9, 0.7, 0.5))
 define_surv_table(x)
#>   time survival
#> 1    0      1.0
#> 2    1      0.9
#> 3    5      0.7
#> 4   10      0.5