gen_data              package:coxrobust              R Documentation

_G_e_n_e_r_a_t_e _D_a_t_a _f_r_o_m _t_h_e _P_r_o_p_o_r_t_i_o_n_a_l _H_a_z_a_r_d_s _R_e_g_r_e_s_s_i_o_n _M_o_d_e_l

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

     Generates data set from the proportional hazards regression model
     without or with contamination.

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

     gen_data(n, beta, cont = 0, p.censor = 0)

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

       n: number of observations.

    beta: vector of regression coefficients.

    cont: fraction of contaminated observations.

p.censor: probability of censoring.

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

     Covariates are generated independently, each from the standard
     normal distribution.  Baseline hazard is equal to 1.  After
     generation of survival times, covariates are replaced by
     independent 2N(0,1)+1 variables in fraction 'cont' of
     observations.

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

     Data frame containing the following variables:

    time: vector of survival times.

  status: vector of censoring status.

X1, X2, ...: explanatory variables (their number is determined by the
          dimension of vector of regression coefficients).

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

     'coxph', 'coxr'

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

     gen_data(50, c(2,-2), cont = 0.05)

