Create a Survival Object
Create a survival object, usually used as a response variable in a model formula.
Surv(time, event) or Surv(time, time2, event, type=, origin=0) is.Surv(x)
- for right censored data, this is the follow up time. For interval data, the first argument is the starting time for the interval.
- any S-PLUS object.
- The status indicator, normally 0=alive, 1=dead. Other choices are T/F
(TRUE = death) or 1/2 (2=death).
For interval censored data, the status indicator is 0=right censored,
1= event at
time, 2=left censored, 3=interval censored. Although unu
- ending time of the interval for interval censored or counting process
assumed to be open on the left and closed on the right,
(start, end]. For counting process data,
eventindicates whether an event o
- character string specifying the type of censoring. Possible values
"interval2". The default is
- for counting process data, the hazard function origin. This is most often used in conjunction with a model containing time dependent strata in order to align the subjects properly when they cross over from one strata to another.
- An object of class
Surv. There are methods for
is.na, and subscripting survival objects. To include a survival object inside a data frame, use the
Survobjects are implemented as a matrix of 2 or 3 columns.
In the case of
is.Surv, a logical value
xinherits from class
"Surv", otherwise an
In theory it is possible to represent interval censored data without a third column containing the explicit status. Exact, right censored, left censored and interval censored observation would be represented as intervals of (a,a), (a, infinity), (-infinity,b), and (a,b) respectively; each specifying the interval within which the event is known to have occurred.
type = "interval2" then the representation given above is
assumed, with NA taking the place of infinity. If `type="interval"
event must be given. If
2, the relevant
information is assumed to be contained in
time, the value in
is ignored, and the second column of the result will contain a
Presently, the only methods allowing interval censored data are the
parametric models computed by
so the distinction between open and closed intervals
The distinction is important for counting process data and
the Cox model.
The function tries to distinguish between the use of 0/1 and 1/2 coding for
left and right censored data using
If 1/2 coding is used and all the subjects are censored, it will
guess wrong. Use 0/1 coding in this case.
data(aml) Surv(aml$time, aml$status)