convert the recorded event time per patient to the number of events per interval per patient
Source:R/step1_cpiu.R
patients_to_cpius.Rdconvert the recorded event time per patient to the number of events per interval per patient
Usage
patients_to_cpius(
data_to_convert,
units_of_cpiu,
weights_by_status = c(0, 1, 1),
pseudo_risk = TRUE,
wide_format = TRUE
)Arguments
- data_to_convert:
a data frame with columns of Id, X, Status
- units_of_cpiu:
a vector of units of CPIU
- weights_by_status:
a vector of weights by status, default is c(0,1,1) for censoring (status: 0), terminal event(status: 1) and recurrent event(status: 1)
- pseudo_risk:
a boolean value indicating whether to use pseudo risk time