prodlim (version 2019.11.13)

getEvent: Extract a column from an event history object.

Description

Extract a column from an event history object, as obtained with the function Hist.

Usage

getEvent(object, mode = "factor", column = "event")

Arguments

object

Object of class "Hist".

mode

Return mode. One of "numeric", "character", or "factor".

column

Name of the column to extract from the object.

Author

Thomas Alexander Gerds <tag@biostat.ku.dk>

Details

Since objects of class "Hist" are also matrices, all columns are numeric or integer valued. To extract a correctly labeled version, the attribute states of the object is used to generate factor levels.

See Also

Hist

Examples

Run this code

  dat= data.frame(time=1:5,event=letters[1:5])
  x=with(dat,Hist(time,event))
  ## inside integer
  unclass(x)
  ## extract event (the extra level "unknown" is for censored data)
  getEvent(x)

Run the code above in your browser using DataLab