survregDtest            package:survival            R Documentation

_V_e_r_i_f_y _a _s_u_r_v_r_e_g _d_i_s_t_r_i_b_u_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     This routine is called by 'survreg' to verify that a distribution
     object is valid.

_U_s_a_g_e:

     survregDtest(dlist, verbose = F)

_A_r_g_u_m_e_n_t_s:

   dlist: the list describing a survival distribution

 verbose: return a simple TRUE/FALSE from the test for validity (the
          default), or a verbose description of any flaws.

_D_e_t_a_i_l_s:

     If the 'survreg' function rejects your user-supplied distribution
     as invalid, this routine will tell you why it did so.

_V_a_l_u_e:

     TRUE if the distribution object passes the tests, and either FALSE
     or a vector of character strings if not.

_A_u_t_h_o_r(_s):

     Terry Therneau

_S_e_e _A_l_s_o:

     'survreg.distributions', 'survreg'

_E_x_a_m_p_l_e_s:

     # An invalid distribution (it should have "init =" on line 2)
     #  surveg would give an error message
     mycauchy <- list(name='Cauchy',
                      init<- function(x, weights, ...) 
                           c(median(x), mad(x)),
                      density= function(x, parms) {
                           temp <- 1/(1 + x^2)
                           cbind(.5 + atan(temp)/pi, .5+ atan(-temp)/pi,
                                 temp/pi, -2 *x*temp, 2*temp^2*(4*x^2*temp -1))
                           },
                      quantile= function(p, parms) tan((p-.5)*pi),
                      deviance= function(...) stop('deviance residuals not defined')
                      )

     survregDtest(mycauchy, TRUE)

