survival
package Surv
functionSrv
saves labeling and time units information when creating
Surv
objects. The subsetting method preserves these extra attributes.Srv(time, time2, event,
type = c("right", "left", "interval", "counting", "interval2",
"mstate"), origin = 0)
Surv
"Srv"
plus classes from Surv
Surv
dtime <- c(1, 3, 7); death <- c(1, 0, 1)
units(dtime) <- 'Month'
label(dtime) <- 'Event/censoring time'
label(death) <- 'Death, all causes'
S <- Srv(dtime, death)
attributes(S)
S[2:3,]
attributes(S[2:3,])
Run the code above in your browser using DataLab