| Survcomp {surv2sample} | R Documentation |
Create an object representing right-censored data with competing risks (types of failure).
Survcomp(time, event) is.Survcomp(x)
time |
survival times (possibly right-censored). |
event |
the status indicator, 0 = censored, 1 = dead from cause 1, 2 = dead from cause 2,... Successive integers 1,2,... must be used for causes. |
x |
any object. |
This is an extension of the standard function Surv of
the package survival. Surv allows only death and
censoring, while Survcomp handles causes of death.
Survcomp returns a matrix of class "Survcomp" with two
columns (survival times,
event types) with attribute "ncauses" containing the number
of different causes of death (which is max(event)). There is a
print method for objects of class "Survcomp", and the function
is.Survcomp for testing whether an object is of this class.
David Kraus (http://www.davidkraus.net/)
## bone marrow transplant data data(bmt1) ## cause of failure printed in brackets ## censored observations have a "+" print(a <- Survcomp(bmt1$time, bmt1$event)) is.Survcomp(a) ## what's inside str(a)