Create a Survival Object

DESCRIPTION:
Create a survival object, usually used as a response variable in a model formula.

USAGE:
Surv(time, event)
or
Surv(time, time2, event, type=<<see below>>, origin=0)
is.Surv(x)

REQUIRED ARGUMENTS:
time:
for right censored data, this is the follow up time. For interval data, the first argument is the starting time for the interval.
x:
any S-PLUS object.

OPTIONAL ARGUMENTS:
time2:
ending time of the interval for interval censored or counting process data only. Intervals are assumed to be open on the left and closed on the right, (start, end]. For counting process data, event indicates whether an event occurred at the end of the interval.
event:
status indicator, normally 0 = alive and 1 = dead. Other choices are T/F (T = death) or 1/2 (2=death). For interval censored data, the status indicator is 0 = right censored, 1 = event at time, 2 = left censored, and 3 = interval censored.
type:
character string specifying the type of censoring. Possible values are "right", "left", "counting", "interval", or "interval2". The default is "right" or "counting" depending on whether the time2 argument is absent or present, respectively.
origin:
hazard function origin for counting process data. Most often used in a model containing time dependent strata to align the subjects properly when they change from one strata to another.

VALUE:
In the case of Surv, a matrix of 2 or 3 columns of class "Surv" containing time, time2 (if provided), and status. To include a "Surv" object in a data frame, use the I function.

In the case of is.Surv, a logical value T if x inherits from class "Surv", otherwise an F.


METHOD:
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 interval is a pair of time points within which the event is known to have occurred.

If type = "interval2", the representation given above is assumed, with NA taking the place of infinity. If type = "interval", event must be given. If event is 0, 1, or 2, the relevant information is assumed to be contained in time, the value in time2 is ignored, and the second column of the result contains a placeholder.

Presently, the only methods allowing interval censored data are the parametric models computed by survreg, so the distinction between open and closed intervals is unimportant. The distinction is important for counting process data and the Cox model but interval censoring is currently not implemented for coxph.


SEE ALSO:
coxph , survfit , survreg .

EXAMPLES:
Surv(leukemia$time, leukemia$status)
Surv(heart$start, heart$stop, heart$event)