Learn R Programming

eventTrack (version 1.0.4)

kaplanMeier_at_t0: Compute value of Kaplan-Meier estimate at a given time

Description

Compute value of Kaplan-Meier estimate at a given time \(t_0\).

Usage

kaplanMeier_at_t0(time, event, t0)

Value

Matrix with values of Kaplan-Meier estimate at \(t_0\).

Arguments

time

Event times, censored or observed.

event

Censoring indicator, 1 for event, 0 for censored.

t0

Vector (or single number) of time points to compute confidence interval for.

Author

Kaspar Rufibach (maintainer)
kaspar.rufibach@roche.com

Examples

Run this code
# use Acute Myelogenous Leukemia survival data contained in package 'survival'
time <- leukemia[, 1]
status <- leukemia[, 2]

tmp <- Surv(time, status) ~ 1
plot(survfit(tmp, conf.type = "none"), mark = "/", col = 1:2)
kaplanMeier_at_t0(time, status, t0 = c(10, 25, 50))

Run the code above in your browser using DataLab