survdiffr              package:survrec              R Documentation

_T_e_s_t _m_e_d_i_a_n _s_u_r_v_i_v_a_l _d_i_f_f_e_r_e_n_c_e_s (_o_r _o_t_h_e_r _q_u_a_n_t_i_l_e)

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

     Obtain bootstrap replicates of the median survival time for
     different groups of subjects. We can compute confidence intervals
     using boot package.

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

     survdiffr(formula, data, q, B = 500, boot.F = "WC", boot.G = "none", ...)

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

 formula: A formula object. If a formula object is supplied it must
          have a Survr object as the response on the left of the ~
          operator and a term on the right. For a single bootstrap
          median survival the "~1" part of the formula is required. 

    data: A data frame in wich to interpret the variables named in the
          formula.

       q: Quantile that we are interested in to obtain a bootstrap
          sample  from survival function 

       B: Number of boostrap samples 

  boot.F: a character string specifying the boostrap procedure. 
          Possible value are either "PSH" or "WC" for nonparametric
          boostrap  or "semiparametric" for semiparametric boostrap.
          The default is "WC". Only the first words are required, e.g
          "P","W","se" 

  boot.G: a character string specifying if we also resample form
          censored empirical  distribution. Possible value are either
          "none" or "empirical". The default is "none". Only the first
          words are required, e.g "n","e"

     ...: additional arguments passed to the type of estimator.

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

     See reference. Some procedures can be slow

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

     A boot object. Bootstrap confidence intervals can be computed
     using boot.ci function from boot package

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

     Gonzalez JR, Pea EA. Bootstraping median survival with recurrent
     event data.  IX Conferencia Espaola de Biometra; 2003 May 28-30;
     A Corua, Espaa.

     Paper available upon request to the mantainer

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

     'survfitr','boot.ci'

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

     data(colon)

     #We will compare the median survival time for three dukes stages
     fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.5)
     boot.ci(fit$"1")
     boot.ci(fit$"2")
     boot.ci(fit$"3")

     # 75th quantile of survival function
     fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.75)
     # bootstrap percentile confidence interval
     quantile(fit$"1"$t,c(0.025,0.975))
     quantile(fit$"2"$t,c(0.025,0.975))
     quantile(fit$"3"$t,c(0.025,0.975))

     # We can execute this if there is none Inf value
     # boot.ci(fit$"1")
     # boot.ci(fit$"2")
     # boot.ci(fit$"3")

     #We can modify the bootstrap procedure modifiying boot.F parameter
     fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.5,boot.F="PSH")
     # bootstrap percentile confidence interval
     quantile(fit$"1"$t,c(0.025,0.975))
     quantile(fit$"2"$t,c(0.025,0.975))
     quantile(fit$"3"$t,c(0.025,0.975))

