Learn R Programming

mets (version 1.3.11)

cif_yearslost: Restricted Mean Time Lost for Competing Risks

Description

Computes the Restricted Mean Time Lost (RMTL) for competing risks based on the integrated Aalen-Johansen estimator.

Usage

cif_yearslost(formula, data = data, cens.code = 0, times = NULL, ...)

Value

An object of class "resmean_phreg" containing:

cumhaz

Matrix of cumulative hazards (years lost).

se.cumhaz

Standard errors.

intF1times

Years lost at specified times.

causes

Vector of cause codes.

Arguments

formula

Formula for phreg object with strata to indicate strata, or +1 if no strata.

data

Data frame for calculations.

cens.code

Censoring code (needed to separate event codes from censorings).

times

Possible times for which to report restricted mean. Summary displays estimates for these times.

...

Additional arguments passed to phreg.

Author

Thomas Scheike

Details

A set of time points can be given to be returned in the summary, but the function computes years-lost for all event times and can be plotted/viewed. The RMTL for a specific time-point can also be computed using the rmstIPCW function.

Examples

Run this code
data(bmt)
bmt$time <- bmt$time + runif(408) * 0.001

## Years lost decomposed into causes
drm1 <- cif_yearslost(Event(time, cause) ~ strata(tcell, platelet), data = bmt, times = c(40, 50))
par(mfrow = c(1, 2))
plot(drm1, cause = 1, se = 1)
plot(drm1, cause = 2, se = 1)
summary(drm1)
estimate(drm1, cause = 1)
estimate(drm1, cause = 2)

## Comparing populations
drm1 <- cif_yearslost(Event(time, cause) ~ strata(tcell, platelet), data = bmt, times = 40)
summary(drm1, contrast = list(1:4))
e1 <- estimate(drm1)
estimate(e1, rbind(c(1, -1, 0, 0)))

Run the code above in your browser using DataLab