bootkm                 package:Hmisc                 R Documentation

_B_o_o_t_s_t_r_a_p _K_a_p_l_a_n-_M_e_i_e_r _E_s_t_i_m_a_t_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     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).

_U_s_a_g_e:

     bootkm(S, q=0.5, B=500, times, pr=TRUE)

_A_r_g_u_m_e_n_t_s:

       S: a 'Surv' object for possibly right-censored survival time 

       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 'q'
          and 'times', and if 'times' is specified 'q' is ignored. 

      pr: set to 'FALSE' to suppress printing the iteration number
          every 10 iterations 

_D_e_t_a_i_l_s:

     'bootkm' uses Therneau's 'survfit.km' function to efficiently
     compute Kaplan-Meier estimates.

_V_a_l_u_e:

     a vector containing 'B' bootstrap estimates

_S_i_d_e _E_f_f_e_c_t_s:

     updates '.Random.seed', and, if 'pr=TRUE', prints progress of
     simulations

_A_u_t_h_o_r(_s):

     Frank Harrell 
      Department of Biostatistics 
      Vanderbilt University School of Medicine 
      f.harrell@vanderbilt.edu

_R_e_f_e_r_e_n_c_e_s:

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

_S_e_e _A_l_s_o:

     'survfit', 'survfit.km', 'Surv', 'Survival.cph', 'Quantile.cph'

_E_x_a_m_p_l_e_s:

     # 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

