quantileCumInc: Quantile of a cumulative incidence estimate

View source: R/quantileCumInc.R

quantileCumIncR Documentation

Quantile of a cumulative incidence estimate

Description

In survival analysis, often some quantiles (e.g., the median) of an estimated cumulative incidence function are of interest. This function computes quantiles of cumulative incidence functions using cuminc of the package cmprsk.

Usage

quantileCumInc(time, event, group, quant = 0.5)

Arguments

time

Event times, censored or observed.

event

Event indicator.

group

Quantiles can be computed for several survival curves, defined by group.

quant

Quantile to be computed. Real number in [0, 1].

Value

data.frame with quantiles estimates for each event-group combination.

Author(s)

Kaspar Rufibach
kaspar.rufibach@gmail.com

See Also

cuminc and timepoint in the package cmprsk.

Examples


if (require("cmprsk")) {
  ## illustrate on simulated data
  set.seed(1977)
  n <- 180
  time <- rgamma(n, 2, 1)
  status <- factor(sample(rep(0:2, n / 3)), levels = 0:2,
                   labels = c("censored", "Time to 2nd tumor", "Death"))
  x <- factor(round(runif(n, 1, 2)), levels = 1:2,
              labels = c("Tmt A", "Tmt B"))
  
  ## plot
  plot(cuminc(time, status, x))

  ## median time to event
  quantileCumInc(time, status, group = x, quant = 0.25)
}


felix-hof/biostatUZH documentation built on Sept. 27, 2024, 1:48 p.m.