Description Usage Arguments Details Value Side Effects Author(s) References See Also Examples

Bootstraps Kaplan-Meier estimate of the probability of survival to at
least a fixed time (`times`

variable) or the estimate of the `q`

quantile of the survival distribution (e.g., median survival time, the
default).

1 |

`S` |
a |

`q` |
quantile of survival time, default is 0.5 for median |

`B` |
number of bootstrap repetitions (default=500) |

`times` |
time vector (currently only a scalar is allowed) at which to compute
survival estimates. You may specify only one of |

`pr` |
set to |

`bootkm`

uses Therneau's `survfitKM`

function to efficiently
compute Kaplan-Meier estimates.

a vector containing `B`

bootstrap estimates

updates `.Random.seed`

, and, if `pr=TRUE`

, prints progress
of simulations

Frank Harrell

Department of Biostatistics

Vanderbilt University School of Medicine

[email protected]

Akritas MG (1986): Bootstrapping the Kaplan-Meier estimator. JASA 81:1032–1038.

`survfit`

, `Surv`

,
`Survival.cph`

, `Quantile.cph`

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
# Compute 0.95 nonparametric confidence interval for the difference in
# median survival time between females and males (two-sample problem)
set.seed(1)
library(survival)
S <- Surv(runif(200)) # no censoring
sex <- c(rep('female',100),rep('male',100))
med.female <- bootkm(S[sex=='female',], B=100) # normally B=500
med.male <- bootkm(S[sex=='male',], B=100)
describe(med.female-med.male)
quantile(med.female-med.male, c(.025,.975), na.rm=TRUE)
# na.rm needed because some bootstrap estimates of median survival
# time may be missing when a bootstrap sample did not include the
# longer survival times
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.