50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

rms (version 4.1-0)

Srv: Front-end to survival package Surv function

Description

Srv saves labeling and time units information when creating Surv objects. The subsetting method preserves these extra attributes.

Usage

Srv(time, time2, event,
    type = c("right", "left", "interval", "counting", "interval2",
             "mstate"), origin = 0)

Arguments

time,time2,event,type,origin
see Surv

Value

  • a matrix of class "Srv" plus classes from Surv

See Also

Surv

Examples

Run this code
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