surv.search             package:survrec             R Documentation

_C_a_l_c_u_l_a_t_e _t_h_e _s_u_r_v_i_v_a_l _i_n _s_e_l_e_c_t_e_d _t_i_m_e_s

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

     Auxiliary function called from pshPLE, wcPLE and MLEFrailty.

     The estimation using PLE (e.g. Kaplan-Meier) is a decreasing
     constant piecewise function with jumps in the times with events.
     Thus, to estimate the survival at any time we take the time of the
     precious event.

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

       surv.search(tvals,time,surv) 
      

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

   tvals: vector of times where the survival function has to be
          estimated

    time: vector of failures times (distinct)

    surv: vector of survival of each time

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

     Returns the survival in each selected time (tvals) from a vector
     of survival values

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

     # we have the times 4,7,9,15,21,67
     time<-c(4,7,9,15,21,67)

     # and its survival (note: in this example there may be more
     #                         than one event in some times)
     surv<-c(0.8,0.7,0.65,0.55,0.43,0.22)

     # We want to calculated the survival at times 1, 10, 32,64
     surv.search(c(1,10,32,74),time,surv)

