rc_setup {JMbayes2} | R Documentation |
Combine Recurring and Terminal Event Data in Long Format
Description
This function combines two data frames, the recurring-event and terminal-event/competing-risks datasets, into one. Each subject has as many rows in the new data frame as the number of recurrent risk periods plus one for each terminal event/competing risk.
Usage
rc_setup(rc_data, trm_data,
idVar = "id", statusVar = "status",
startVar = "start", stopVar = "stop",
trm_censLevel,
nameStrata = "strata", nameStatus = "status")
Arguments
rc_data |
the data frame containing the recurring-event data with multiple rows per subject. |
trm_data |
the data frame containing the terminal-event/competing-risks data with a single row per subject. |
idVar |
a character string denoting the name of the variable in
|
statusVar |
a character string denoting the name of the variable in
|
startVar |
a character string denoting the name of the variable in
|
stopVar |
a character string denoting the name of the variable in
|
trm_censLevel |
a character string or a scalar denoting the censoring
level in the statusVar variable of |
nameStrata |
a character string denoting the variable that will be added
in the long version of |
nameStatus |
a character string denoting the variable that will be added
in the long version of |
Value
A data frame in the long format with multiple rows per subject.
Author(s)
Pedro Miranda Afonso p.mirandaafonso@erasmusmc.nl