View source: R/bootSurvivalSample.r
bootSurvivalSample | R Documentation |
Generate bootstrap samples from a survival object, for right-censored data. See Efron (1981) and Akritas (1986) for details.
bootSurvivalSample(surv.obj, n, M = 1000)
surv.obj |
|
n |
Size of the bootstrap samples to be drawn from |
M |
Number of bootstrap samples to be drawn. |
Matrix with bootstrap samples as columns.
Kaspar Rufibach (maintainer)
kaspar.rufibach@roche.com
Akritas, M.G. (1986). Bootstrapping the Kaplan-Meier Estimator. JASA, 81, 1032-1038
Efron, B. (1981). Censored Data and the Bootstrap. JASA, 76, 312-319.
# --------------------------------------------------
# simulate data for illustration
# --------------------------------------------------
set.seed(2021)
n <- 600
time <- rexp(n, rate = log(2) / 20)
event <- sample(round(runif(n, 0, 1)))
# --------------------------------------------------
# draw 20 bootstrap samples of size 10
# --------------------------------------------------
bootSurvivalSample(surv.obj = Surv(time, event), n = 10, M = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.