View source: R/quantileCumInc.R
quantileCumInc | R Documentation |
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.
quantileCumInc(time, event, group, quant = 0.5)
time |
Event times, censored or observed. |
event |
Event indicator. |
group |
Quantiles can be computed for several survival curves, defined
by |
quant |
Quantile to be computed. Real number in |
data.frame with quantiles estimates for each event-group combination.
Kaspar Rufibach
kaspar.rufibach@gmail.com
cuminc
and timepoint
in the package cmprsk.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.