Define a partitioned survival model with progression-free survival and overall survival.

define_part_surv(
  pfs,
  os,
  state_names,
  terminal_state = FALSE,
  cycle_length = 1
)

define_part_surv_(pfs, os, state_names, cycle_length = 1)

Arguments

pfs, os

Either results from flexsurv::flexsurvreg() or define_survival().

state_names

named character vector, length 3 or 4. State names for progression-free state, progression, (optionally terminal) and death respectively. Elements should be named "progression_free", "progression", (optionally "terminal"), and "death". See examples.

terminal_state

Should a terminal state be included? Only used when state names are not provided.

cycle_length

The value of a Markov cycle in absolute time units.

Value

A part_surv object.

Examples

dist_pfs <- define_survival("exp", rate = 1) dist_os <- define_survival("exp", rate = .5) define_part_surv( pfs = dist_pfs, os = dist_os, state_names = c( progression_free = "A", progression = "B", terminal = "C", death = "D" ) )
#> $pfs #> <lazy> #> expr: dist_pfs #> env: <environment: 0x55f42f50a7b0> #> #> $os #> <lazy> #> expr: dist_os #> env: <environment: 0x55f42f50a7b0> #> #> $state_names #> progression_free progression terminal death #> "A" "B" "C" "D" #> #> $cycle_length #> [1] 1 1 #> #> attr(,"class") #> [1] "part_surv"
# identical to: define_part_surv( pfs = dist_pfs, os = dist_os, terminal_state = TRUE )
#> No named state -> generating names.
#> $pfs #> <lazy> #> expr: dist_pfs #> env: <environment: 0x55f42f50a7b0> #> #> $os #> <lazy> #> expr: dist_os #> env: <environment: 0x55f42f50a7b0> #> #> $state_names #> progression_free progression terminal death #> "A" "B" "C" "D" #> #> $cycle_length #> [1] 1 1 #> #> attr(,"class") #> [1] "part_surv"