R: Create a survival object

Surv2 {survival} | R Documentation

## Create a survival object

### Description

Create a survival object from a timeline style data set. This will almost always be the response variable in a formula.

### Usage

    Surv2(time, event)

### Arguments

`time` | a timeline variable, such as age, time from enrollment, date, etc.
`event` | the outcome at that time. This can be a 0/1 variable, TRUE/FALSE, or a factor. If the latter, the first level of the factor corresponds to ‘no event was observed at this time’.

### Details

When used in a `coxph` or `survfit` model, Surv2 acts as a trigger to internally convert a timeline style data set into counting process style data, which is then acted on by the routine.

### Value

An object of class `Surv2`. There are methods for `print`, `is.na` and subscripting.

### See Also

`coxph`, `survfit`

[Package survival version 3.2-7 Index]