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)

