home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / survival4 / residuals.coxph < prev    next >
Encoding:
Text File  |  1997-09-13  |  2.9 KB  |  73 lines

  1.     
  2.     _C_a_l_c_u_l_a_t_e _r_e_s_i_d_u_a_l_s _f_o_r _a _c_o_x_p_h _f_i_t. _C_a_l_c_u_l_a_t_e_s _m_a_r_t_i_n_g_a_l_e,
  3.     _d_e_v_i_a_n_c_e, _s_c_o_r_e _o_r _S_c_h_o_e_n_f_e_l_d _r_e_s_i_d_u_a_l_s _f_o_r _a _C_o_x _p_r_o_p_o_r_-
  4.     _t_i_o_n_a_l _h_a_z_a_r_d_s _m_o_d_e_l.
  5.     
  6.          resid(object,
  7.                 type=c("martingale", "deviance", "score", "schoenfeld",
  8.                    "dfbeta", "dfbetas", "scaledsch"),
  9.                 collapse, weighted=F)
  10.     
  11.     _A_r_g_u_m_e_n_t_s:
  12.     
  13.            object:
  14.          a coxph object, output from a coxph fit.
  15.     
  16.              type:
  17.          character string indicating the type of residual
  18.          desired; the default is martingale.  Only enough of the
  19.          string to determine a unique match is required.
  20.     
  21.          collapse:
  22.          Vector indicating which rows to collapse(sum) over.  In
  23.          time-dependent models more than one row data can per-
  24.          tain to a single individual.  If there were 4 individu-
  25.          als represented by 3, 1, 2 and 4 rows of data respec-
  26.          tively, then collapse=c(1,1,1, 2, 3,3, 4,4,4,4) could
  27.          be used to obtain per subject rather than per observa-
  28.          tion residuals.
  29.     
  30.          weighted:
  31.          if TRUE and the model was fit with case weights, then
  32.          the weighted residuals are returned.
  33.     
  34.          Value:
  35.     
  36.          For martingale and deviance residuals, the returned
  37.          object is a vector with one element for each subject
  38.          (without collapse).  For score residuals it is a matrix
  39.          with one row per subject and one column per variable.
  40.          The row order will match the input data for the origi-
  41.          nal fit.  For Schoenfeld residuals, the returned object
  42.          is a matrix with one row for each event and one column
  43.          per variable.  The rows are ordered by time within
  44.          strata, and an attribute strata is attached that con-
  45.          tains the number of observations in each strata.  The
  46.          scaled Schoenfeld residuals are used in the cox.zph
  47.          function.  The score residuals are each individual's
  48.          contribution to the score vector.  Two transformatons
  49.          of this are often more useful: dfbeta is the approxi-
  50.          mate change in the coefficient vector if that observa-
  51.          tion were dropped, and 'dfbetas' is the approximate
  52.          change in the coefficients, scaled by the standard
  53.          error for the coefficients.
  54.     
  55.          For deviance residuals, the status variable may need to
  56.          be reconstructed.  For score and Shoenfeld residuals,
  57.          the X matrix will need to be reconstructed.
  58.     
  59.          References:
  60.     
  61.          T.Therneau, P. Grambsch, and T.Fleming. "Martingale
  62.          based residuals for survival models", Biometrika, March
  63.          1990.
  64.     
  65.          coxph
  66.     
  67.     _E_x_a_m_p_l_e_s:
  68.     
  69.          > attach(jasa1)
  70.          > fit <- coxph(Surv(start, stop, event) ~ (age + surgery)* transplant)
  71.          > mresid <- resid(fit, collapse=jasa1d)
  72.     
  73.