CR_Response: Competing Risk Response

Description Usage Arguments Details Examples

View source: R/CR_Response.R

Description

Takes vectors of event time and event type and turns it into the internal objects used throughout the package. The result of this function shouldn't be used directly, but should instead by provided as the y parameter in train.

Usage

1
CR_Response(delta, u, C = NULL)

Arguments

delta

A vector of integers detailing the event that occurred. A value of 0 denotes that censoring occurred first and that time was recorded.

u

A numeric vector detailing the recorded event times (possibly censored).

C

If the censoring times are known for all observations, they can be included which allows for GrayLogRankSplitFinder to be used. Default is NULL.

Details

To be clear, if T1,...TJ are the J different competing risks, and C is the censoring time, then u[i] = min(T1[i], ...TJ[i], C[i]); and delta[i] denotes which time was the minimum, with a value of 0 if C[i] was the smallest.

Examples

1
2
3
4
5
6
7
8
9
T1 <- rexp(10)
T2 <- rweibull(10, 2, 2)
C <- rexp(10)

u <- pmin(T1, T2, C)
delta <- ifelse(u == T1, 1, ifelse(u == T2, 2, 0))

responses <- CR_Response(delta, u)
# Then use responses in train or naiveConcordance

jatherrien/largeRCRF documentation built on Nov. 15, 2019, 7:16 a.m.