Learn R Programming

emil (version 1.1-6)

outcome: Create a vector of outcomes

Description

Heavily modeled after the Surv class in the `survival` package. Objects of this class are internally stored as data frames but should be thought of as vectors and can be treated as such through out.

Usage

outcome(time, event, levels, censor)

Arguments

time
Time points at which an event occurred.
event
The type of event that occurred. NA codes for no event.
levels
Which levels of event to keep. Defaults to all unique values of event.
censor
What values of event should be considered censoring. Defaults to NA and all values in event not present in levels.

Value

  • A vector of outcomes.

See Also

factor.events, integer.events, plot.outcome.

Examples

Run this code
outcome(runif(15), sample(c(NA, "Mechanical failure", "Out of fuel"), 15, TRUE))

Run the code above in your browser using DataLab