Crisk {fastcmprsk}R Documentation

Create a Competing Risk Object

Description

Create a competing risk object, used as a response variable in the model formula for fastCrr and fastCrrp. Adapted from the Surv object.

Usage

Crisk(ftime, fstatus, cencode = 0, failcode = 1, silent = TRUE)

Arguments

ftime

A vector of event/censoring times.

fstatus

A vector with unique code for each event type and a separate code for censored observations.

cencode

Integer: code of fstatus that denotes censored observations (default is 0)

failcode

Integer: code of fstatus that event type of interest (default is 1)

silent

Logical: print information about coding.

Value

Returns an object, used as a response variable, of class Crisk.

time

vector of observed event times

status

vector of event indicators. 0 = censored, 1 = event of interest, 2 = competing risks

References

Fine J. and Gray R. (1999) A proportional hazards model for the subdistribution of a competing risk. JASA 94:496-509.

See Also

Surv

Examples

library(fastcmprsk)

set.seed(10)
ftime <- rexp(200)
fstatus <- sample(0:2, 200, replace = TRUE)
obj <- Crisk(ftime, fstatus, silent = FALSE)

[Package fastcmprsk version 1.24.5 Index]