multidf: Create a multidf object

Description Usage Arguments Details Value Author(s) Examples

Description

Creates a "multidf" object, usually used as a response variable in a model formula.

Usage

1
multidf(time1, time, event1, status, ...)

Arguments

time1

First time or censoring time.

time

The total time of the process.

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.

...

Other options. For instance, for three gap times: time2 represent the second time and event2 the censoring indicator of the second time; 0 if the second time is censored and 1 otherwise. Other 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: time1, event1, time and status, where time1 and time are ordered event times and event1 and event 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data("bladder4state")
b3state <- multidf(time1=bladder4state$y1, event1=bladder4state$d1, 
                  time=bladder4state$y1+bladder4state$y2,status=bladder4state$d2)
head(b3state[[1]])
data("bladder4")

b4 <- multidf(time1=bladder4$t1, event1=bladder4$d1,
             time2= bladder4$t2, event2=bladder4$d2,
             time=bladder4$t3, status=bladder4$d3)
head(b4state[[1]])

gsoutinho/survrec documentation built on Dec. 20, 2021, 1:46 p.m.