kapmeier              package:epitools              R Documentation

_I_m_p_l_e_m_e_n_t_s _p_r_o_d_u_c_t-_l_i_m_i_t (_K_a_p_l_a_n-_M_e_i_e_r) _m_e_t_h_o_d

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

     Implements product-limit (Kaplan-Meier) method for time-to-event
     data with censoring.

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

     kapmeier(time, status)

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

    time: numeric vector with individual observation times

  status: integer vector indicating status at the end of the
          observation time: 1 = event, 0 = censored

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

     This function implements the product-limit method for estimating
     survival probability for time-to-event data with censoring:


         S(t) = product[(nj - dj) / nj] for all tj <= t,

     where 'tj' are event times (i.e., times at which one or more
     events occur), 'nj' are the number at risk at time 'tj' (by
     convention, subjects censored at time 'tj' are considered at-risk
     and included in 'nj'), and 'dj' are the number of events at time
     'tj'.

     A primary purpose of this function was to demonstrate the use of
     available R functions to implement a simple statistical method.
     For example, 'kapmeier' uses 'sort', 'order', 'duplicated',
     'tapply', 'unique', 'cumprod', 'cbind', and 'dimnames'. Studying
     this function carefully helps one understand and appreciate the
     utility of R functions to implement simple methods.

     For serious survival analysis load the 'survival' package. The
     'survfit' function in this package implements the product-limit
     method and much more. See examples.

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

     Returns an individual-level data frame

_N_o_t_e:

     Visit <URL: http://www.epitools.net> for the latest.

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

     Tomas Aragon, aragon@berkeley.edu, <URL: http://www.medepi.com>

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

     Selvin S. Statistical Analysis of Epidemiologic Data (Monographs
     in Epidemiology and Biostatistics, V. 35). Oxford University
     Press; 3rd edition (May 1, 2004)

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

     See also 'survfit'

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

     ##Product-limit method using 'kapmeier' function
     tt <- c(1,17,20,9,24,16,2,13,10,3)
     ss <- c(1,1,1,1,0,0,0,1,0,1)
     round(kapmeier(tt, ss), 3)

