quantileKM: Quantile of a Kaplan-Meier estimate of a survival function

View source: R/survReport.R

quantileKMR Documentation

Quantile of a Kaplan-Meier estimate of a survival function

Description

In survival analysis, often quantiles (e.g., the median) of an estimated survival function are of interest. The survfit function in the 'survival' packages of version < 2.35 computes median time to event. However, the output of that function is such that the median is not conveniently accessible by the user. This function makes the median and any other quantile accessible by the user.

Usage

quantileKM(
  time,
  event,
  group = NULL,
  quantile = 0.5,
  conf.level = 0.95,
  conf.type = c("log-log", "log", "plain", "none")
)

Arguments

time

Event times, censored or observed.

event

Censoring indicator, 1 for event, 0 for censored.

group

Indicates groups to compute individual quantile for each group. Default is NULL.

quantile

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

conf.level

Significance level for confidence interval for the time to event quantile.

conf.type

Type of confidence interval to be computed. For possible choices see above, and for specifications regarding the different options see survfit.

Value

A list containing a matrix with columns:

n

Number of observations used.

events

Number of events.

quantile

Quantile estimate.

lower.ci

Lower limit of confidence interval.

upper.ci

Upper limit of confidence interval.


and the p-value of the test for the difference between the survival curves; see survdiff for more information.

Note

The function is based on the function survfit.

Author(s)

Kaspar Rufibach

References

Confidence intervals are computed according to

Brookmeyer, R. and Crowley, J. (1982). A Confidence Interval for the Median Survival Time. Biometrics, 38, 29–41.

See Also

survfit, survdiff

Examples


## use Acute Myelogenous Leukemia survival data contained in package 'survival'
time <- leukemia[, 1]
event <- leukemia[, 2]
group <- as.factor(leukemia[, 3])
plot(survfit(Surv(time, event) ~ group, conf.type = "none"), mark = "/", col = 1:2)

## median time to event
quantileKM(time, event, group = group, quantile = 0.5, conf.level = 0.95, 
           conf.type = "log")
 
## comparison to standard function (median time to event not accessible by user)
survfit(Surv(time, event) ~ group, conf.int = 0.95)

## compute 0.25 quantile
quantileKM(time = time, event = event, group = group, quantile = 0.25,
           conf.type = "log")


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