multidf {survivalREC} | R Documentation |
Create a multidf object
Description
Creates a "multidf" object, usually used as a response variable in a model formula.
Usage
multidf(gap1, gap2, gap3=NULL, event1, status, event2=NULL, ...)
Arguments
gap1 |
First gap time. |
gap2 |
Second gap time. |
gap3 |
Third gap time. By default is NULL. |
event1 |
Indicator of the first time; 0 if the first time is censored and 1 otherwise. |
status |
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise. For instance, for three gap times, status is given by the indicator of the third time. |
event2 |
Indicator of the second time; 0 if the first time is censored and 1 otherwise. By default is NULL. |
... |
Other options. Additional arguments, such as covariates, can also be included in the data set. |
Details
Arguments in this function must be introduced in the following
order: gap1
, event1
, gap2
and status
, where
gap1
and gap2
are ordered event times and
event1
and status
their corresponding indicator statuses.
Other arguments can be also added. These should consider intermediate times
and corresponding censoring indicators or covariates.
Value
An object of class "multidf". "multidf" objects are implemented as a single data frame.
Author(s)
Gustavo Soutinho and Luis Meira-Machado
Examples
library(survivalREC)
data("bladder4state")
b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1,
gap2=bladder4state$y2, status=bladder4state$d2,
size=bladder4state$size)
head(b3state[[1]])
class(b3state)
b4state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1,
gap2=bladder4state$y2, event2=bladder4state$d2,
gap3=bladder4state$y3, status=bladder4state$d3,
size=bladder4state$size)
head(b4state[[1]])