cluster               package:survival               R Documentation

_I_d_e_n_t_i_f_y _C_l_u_s_t_e_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     This is a special function used in the context of survival models.
      It identifies correlated groups of observations, and is used on
     the right hand side of a formula.  Using 'cluster()' in a formula
     implies that robust sandwich variance estimators are desired.

_U_s_a_g_e:

     cluster(x)

_A_r_g_u_m_e_n_t_s:

       x: A character, factor, or numeric variable. 

_V_a_l_u_e:

     'x'

_S_e_e _A_l_s_o:

     'coxph', 'Surv'

_E_x_a_m_p_l_e_s:

     frailty.model <- coxph(Surv(time, status)~ age + sex + disease + frailty(id), kidney)
     marginal.model <- coxph(Surv(time, status)~ age + sex + disease+cluster(id), kidney)
     summary(frailty.model)
     summary(marginal.model)

     frailty.model <- survreg(Surv(time, status) ~ rx +  frailty(litter), rats )
     marginal.model <- survreg(Surv(time, status) ~ rx +  cluster(litter), rats )
     summary(frailty.model)
     summary(marginal.model)

