dsurvreg              package:survival              R Documentation

_D_i_s_t_r_i_b_u_t_i_o_n_s _a_v_a_i_l_a_b_l_e _i_n _s_u_r_v_r_e_g.

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

     Density, cumulative probability, and quantiles for the set of
     distributions supported by the 'survreg' function.

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

     dsurvreg(x, mean, scale=1, distribution='weibull', parms)
     psurvreg(q, mean, scale=1, distribution='weibull', parms)
     qsurvreg(p, mean, scale=1, distribution='weibull', parms)

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

       x: vector of quantiles.  Missing values ('NA's) are allowed.  

       q: vector of quantiles.  Missing values ('NA's) are allowed.  

       p: vector of probabilities.  Missing values ('NA's) are allowed.            

    mean: vector of means.  This is replicated to be the same length as
          'p'  or 'q'. 

   scale: vector of (positive) scale factors. This is replicated to be
          the same length as 'p'  or 'q'. 

distribution: character string giving the name of the distribution. 
          This must be one of the elements of 'survreg.distributions' 

   parms: optional parameters, if any, of the distribution.  For the
          t-distribution this is the degrees of freedom. 

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

     Elements of 'q' or  'p' that are missing will cause the
     corresponding  elements of the result to be missing. 

     The 'mean' and 'scale' values are as they would be for 'survreg'.
     In particular, if the distribution is one that involves a
     transformation, then they are the mean and scale of the
     transformed distribution.   For example, the Weibull distribution
     is fit using the Extreme value distribution along with a log
     transformation. Letting F(t) = 1 - exp(-(at)^p) be the cumulative
     distribution of the Weibull, the mean corresponds to -log(a) and
     the scale to 1/p  (Kalbfleish and Prentice, section 2.2.2).

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

     density ('dsurvreg'),  probability ('psurvreg'),  quantile
     ('qsurvreg'), or  for the requested distribution with mean and
     scale parameters 'mean' and  'sd'.

_R_e_f_e_r_e_n_c_e_s:

     Kalbfleish, J. D. and Prentice, R. L. (1970).  _The Statistical
     Analysis of Failure Time Data_ Wiley, New York.

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

     'survreg',  'Normal'

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

     # List of distributions available
     names(survreg.distributions)
     ## Not run: 
      [1] "extreme"     "logistic"    "gaussian"    "weibull"     "exponential"
      [6] "rayleigh"    "loggaussian" "lognormal"   "loglogistic" "t"          
     ## End(Not run)
     # Compare results
     all.equal(dsurvreg(1:10, 2, 5, dist='lognormal'), dlnorm(1:10, 2, 5))

     # Hazard function for a Weibull distribution
     x   <- seq(.1, 3, length=30)
     haz <- dsurvreg(x, 2, 3)/ (1-psurvreg(x, 2, 3))
     ## Not run: 
     plot(x, haz, log='xy', ylab="Hazard") #line with slope (1/scale -1)
     ## End(Not run)

