surv_to_pairs: Given survival information (time and status) for a set of...

Description Usage Arguments Value Examples

Description

Given survival information (time and status) for a set of subjects, compute all pairs (i,j) for which patient i has the event before patient j.

Usage

1
surv_to_pairs(time, event = rep(1, length(time)))

Arguments

time

A vector of follow up time for the subjects

event

A vector of status indicator for the subjects, normally 0=alive, 1=dead. Other choices are TRUE/FALSE (TRUE=death). By default, all subjects are assumed to have an event.

Value

A list of vectors, where the i-th vector is the set of patients that have the events after patient i.

Examples

1
2
3
time <- c(5,6,7,7,8,9)
event <- c(1,0,0,1,1,0)
res <- surv_to_pairs(time,event)

jpvert/apg documentation built on May 19, 2019, 11:51 p.m.