Skip to contents

A Cox model on the subdistribution hazard, in which subjects failing from a competing cause remain in the risk set with a decreasing weight, so the coefficients act directly on the cumulative incidence.

Usage

Finegray(time, cause, X, code = 1, max_iter = 50L, tol = 1e-09)

morie_survival_finegray(time, cause, X, code = 1, max_iter = 50L, tol = 1e-09)

Arguments

time

observed follow-up times.

cause

cause of failure, 0 for censored.

X

covariate matrix, one row per subject.

code

the cause of interest.

max_iter

maximum Newton-Raphson iterations.

tol

convergence tolerance.

Value

list with the coefficients, their standard errors, the log-likelihood and the iteration count.

References

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

Examples

# cause: 1 is the event of interest, 2 a competing event, 0 censored.
time  <- c(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
cause <- c(1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0)
X     <- c(0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0)
Finegray(time = time, cause = cause, X = X)$coef
#> [1] 0.06085108