survSplit              package:survival              R Documentation

_S_p_l_i_t _a _s_u_r_v_i_v_a_l _d_a_t_a _s_e_t _a_t _s_p_e_c_i_f_i_e_d _t_i_m_e_s

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

     Given a survival data set and a set of specified cut times, split
     each record into multiple subrecords at each cut time.  The new
     data set will be in `counting process' format, with a start time,
     stop time, and event status for each record.

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

     survSplit(data, cut, end, event, start, id = NULL, zero = 0,
       episode=NULL)

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

    data: data frame

     cut: vector of timepoints to cut at

     end: character string with name of event time variable 

   event: character string with name of censoring indicator 

   start: character string with name of start time variable (will be
          created if it does not exist) 

      id: character string with name of new id variable to create
          (optional)

    zero: If 'start' doesn't already exist, this is the time that the
          original records start. May be a vector or single value.

 episode: character string with name of new episode variable (optional)

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

     New, longer, data frame.

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

     'Surv', 'cut', 'reshape'

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

     data(aml)
     aml3<-survSplit(aml,cut=c(5,10,50),end="time",start="start",
           event="status",episode="i")

     summary(aml)
     summary(aml3)

     coxph(Surv(time,status)~x,data=aml)
     ## the same
     coxph(Surv(start,time,status)~x,data=aml3)

