Learn R Programming

eha (version 1.2-18)

risksets: Finds the compositions and sizes of risk sets

Description

Focus is on the risk set composition just prior to a failure.

Usage

risksets(x, strata, max.survs)

Arguments

x
A Surv object.
strata
Stratum indicator.
max.survs
Maximum number of survivors in each risk set. If smaller than the 'natural number', survivors are sampled from the present ones.

Value

  • A list with components
  • antrsNo. of risk sets in each stratum. The number of strata is given by length(antrs).
  • risktimesOrdered distinct failure time points.
  • eventsetvector of pointers to events in each risk set.
  • risksetvector of pointers to the members of the risk sets, in order. The 'events' first are the events.
  • sizeThe sizes of the risk sets.
  • n.eventsThe number of events in each risk set.

Details

If the input argument max.survs is left alone, all survivors are accounted for in all risk sets.

See Also

table.events, coxreg.

Examples

Run this code
enter <- c(0, 1, 0, 0)
 exit <- c(1, 2, 3, 4)
 event <- c(1, 1, 1, 0)
 risksets(Surv(enter, exit, event))

Run the code above in your browser using DataLab