km                   package:event                   R Documentation

_K_a_p_l_a_n-_M_e_i_e_r _S_u_r_v_i_v_o_r _C_u_r_v_e_s

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

     'km' calculates the Kaplan-Meier estimates for survival.

     To plot the survivor curve, use 'plot()'; for the empirical
     intensity curve, use 'plot.intensity()'; for diagnostic curves to
     choose a distribution to which the data might belong, use
     'plot.dist()'.

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

     km(times, censor, group=1, freq=1, cdf=FALSE)
     plot.km(z, add=FALSE, xlim, ylim=c(0,1), main=NULL, xlab="Time",
             ylab=NULL, lty=NULL, ...)
     plot.intensity.km(z, add=FALSE, xlab="Time", ylab="Intensity", type="l",
             lty=NULL, ...)
     plot.dist.km(z)

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

   times: Vector of times to events or a list of vectors of such times
          for different individuals.

  censor: Vector of censoring indicators corresponding to the vector of
          times or to the last time in each vector of a list.

   group: Vector indicating to which group each individual belongs.

    freq: Vector of frequencies for grouped data.

     cdf: If TRUE, calculate the cdf instead of the survivor curve.

       z: An object produced by 'km'.

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

     A matrix with class, 'km', containing the Kaplan-Meier estimates
     is returned.

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

     J.K. Lindsey

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

     'plot.intensity', 'plot.survivor'

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

     surv <- rgamma(40,2,scale=5)
     cens <- rbinom(40,1,0.9)
     treat <- gl(2,20)
     plot(km(surv, cens, group=treat), main="",xlab="Months",
             ylab="Probability of deterioration")
     plot.dist(km(surv, cens, group=treat))
     plot.intensity(km(surv, cens, group=treat),ylab="Risk of deterioration")

