residuals.survreg          package:survival          R Documentation

_C_o_m_p_u_t_e _R_e_s_i_d_u_a_l_s _f_o_r '_s_u_r_v_r_e_g' _O_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     This is a method for the function 'residuals' for objects
     inheriting from class 'survreg'.

_U_s_a_g_e:

     residuals.survreg(object, type=c("response", "deviance","dfbeta","dfbetas",
     "working","ldcase","ldresp","ldshape", "matrix"), rsigma=TRUE,
     collapse=FALSE, weighted=FALSE, ...)

_A_r_g_u_m_e_n_t_s:

  object: an object inheriting from class 'survreg'. 

    type: type of residuals, with choices of '"response"',
          '"deviance"', '"dfbeta"', '"dfbetas"', '"working"',
          '"ldcase"', '"lsresp"', '"ldshape"', and '"matrix"'.  See the
          LaTeX documentation ('survival/doc/survival.ps.gz') for more
          detail. 

  rsigma: include the scale parameters in the variance matrix, when
          doing computations. (I can think of no good reason not to). 

collapse: optional vector of subject groups.  If given, this must be of
          the same length as the residuals, and causes the result to be
          per group residuals. 

weighted: give weighted residuals?  Normally residuals are unweighted. 

     ...: other unused arguments

_V_a_l_u_e:

     A vector or matrix of residuals is returned. Response residuals
     are on the scale of the original data, working residuals are on
     the scale of the linear predictor, and deviance residuals are on
     log-likelihood scale. The dfbeta residuals are a matrix, where the
     ith row gives the approximate change in the coefficients due to
     the addition of subject i. The dfbetas matrix contains the dfbeta
     residuals, with each column scaled by the standard deviation of
     that coefficient.

     The matrix type produces a matrix based on derivatives of the
     log-likelihood function.  Let L be the log-likelihood, p be the
     linear predictor X %*% coef, and s be log(sigma).  Then the 6
     columns of the matrix are L, dL/dp,ddL/(dp dp), dL/ds, ddL/(ds ds)
      and ddL/(dp ds).  Diagnostics based on these quantities are
     discussed in an article by Escobar and Meeker. The main ones are
     the likelihood displacement residuals for perturbation of a case
     weight ('ldcase'), the response value ('ldresp'), and the 'shape'.

_R_e_f_e_r_e_n_c_e_s:

     Escobar, L. A. and Meeker, W. Q. (1992). Assessing influence in
     regression analysis with censored data. _Biometrics_ *48*,
     507-528.

_S_e_e _A_l_s_o:

     'predict.survreg'

_E_x_a_m_p_l_e_s:

     data(aml)
     fit <- survreg(Surv(time,status) ~x, aml)
     rr  <- residuals(fit, type='matrix')

