as_pfs_os: Convert multi-state data to PFS and OS data
Description
Convert a multi-state dataset with irreversible transitions containing 3 health
states to a dataset with one row per patient and progression-free survival (PFS)
and overall survival (OS) time-to-event outcomes.
A data.table with one row per patient containing each variable in
patient_vars as well as a time variable and status indicator for both
PFS (pfs_status, pfs_time) and OS (os_time, os_status).
Arguments
data
A multi-state dataset.
patient_vars
Character vector of the names of patient specific variables.
status
Character string with the name of the status variable (1 = event,
0 = censored).
time_stop
Character string with the name of the stopping time variable
(i.e., time patient transitions from state \(r\) to state \(s\)).
transition
Character string with the name of the variable identifying
a transition. The transition variable should be integer valued with values
1, 2, and 3 for the Stable -> Progression, Stable -> Death, and
Progression -> Death transitions, respectively.