iddata {idmTPreg} | R Documentation |
TPreg
Function
Converts a raw illness-death dataset to a data frame which can
be passed into TPreg
function.
iddata(Stime, Sind, Iltime, Ilind, covar, ...)
Stime |
the possibly censored total survival time. |
Sind |
the indicator of uncensored total survival time. |
Iltime |
the arrival time to the intermediate state, for example diseased, recurrence, or relapse time. |
Ilind |
the indicator of visiting intermediate state. |
covar |
a vector of covariates. |
... |
arguments to be passed to methods. |
iddata
returns an object of class data frame, containing at least the following components:
id |
identification variable |
Zt |
the possibly censored sojourn time in initial state |
delta1 |
the indicator of uncensored sojourn time in initial state |
Tt |
the possibly censored total survival time |
delta |
the indicator of uncensored total survival time |
covar |
a vector of covariates |
Stime <- c(10, 20, 34, 12, 30) Sind <- c(1, 0, 0, 1, 1) Iltime <- c(7, 20, 28, 12, 30) Ilind <- c(1, 0, 1, 0, 0) covar <- c(20, 25, 57, 36, 46) mydata <- iddata(Stime, Sind, Iltime, Ilind, covar) mydata