The PHREG Procedure

Residuals

This section describes the computation of residuals (RESMART=, RESDEV=, RESSCH=, and RESSCO=) in the OUTPUT statement.

First, consider TIES=BRESLOW. Let

\begin{eqnarray*}  S^{(0)}(\bbeta ,t) & =&  \sum _{i} Y_{i}(t) \mr{e}^{\bbeta '\bZ _{i}(t)} \\ S^{(1)}(\bbeta ,t) & =&  \sum _{i} Y_{i}(t) \mr{e}^{\bbeta '\bZ _{i}(t)} \bZ _{i}(t) \\ \bar{\bZ }(\bbeta ,t) & =&  \frac{ S^{(1)}(\bbeta ,t)}{ S^{(0)}(\bbeta ,t)} \\ d\Lambda _0(\bbeta ,t) & =&  \sum _ i \frac{dN_ i(t)}{S^{(0)}(\bbeta ,t)} \\ dM_ i(\bbeta ,t)& =& dN_ i(t) - Y_ i(t) \mr{e}^{\bbeta '\bZ _ i(t)} d\Lambda _0(\bbeta ,t) \end{eqnarray*}

The martingale residual at t is defined as

\[  \hat{M}_ i(t) = \int _0^ t dM_ i(\hat{\bbeta },s) = N_ i(t) - \int _0^ t Y_ i(s) \mr{e}^{\hat{\bbeta }'\bZ _ i(s)} d\Lambda _0(\hat{\bbeta },s)  \]

Here $\hat{M}_ i(t)$ estimates the difference over $(0,t]$ between the observed number of events for the ith subject and a conditional expected number of events. The quantity $\hat{M}_ i \equiv \hat{M}_ i(\infty )$ is referred to as the martingale residual for the ith subject. When the counting process MODEL specification is used, the RESMART= variable contains the component ($\hat{M}_ i(t_2) - \hat{M}_ i(t_1)$) instead of the martingale residual at $t_2$. The martingale residual for a subject can be obtained by summing up these component residuals within the subject. For the Cox model with no time-dependent explanatory variables, the martingale residual for the ith subject with observation time $t_ i$ and event status $\Delta _ i$ is

\[  \hat{M}_ i = \Delta _ i - \mr{e}^{\hat{\bbeta }'\bZ _ i} \int _0^{t_ i}d\Lambda _0(\hat{\bbeta },s)  \]

The deviance residuals $D_ i$ are a transform of the martingale residuals:

\[  D_{i}= \mr{sign}(\hat{M}_ i)\sqrt {2 \biggl [ -\hat{M}_ i - N_{i}(\infty ) \log \biggl ( \frac{N_{i}(\infty ) - \hat{M}_ i}{N_{i}(\infty )} \biggr ) \biggr ]}  \]

The square root shrinks large negative martingale residuals, while the logarithmic transformation expands martingale residuals that are close to unity. As such, the deviance residuals are more symmetrically distributed around zero than the martingale residuals. For the Cox model, the deviance residual reduces to the form

\[  D_{i}= \mr{sign}(\hat{M}_ i)\sqrt {2 [ -\hat{M}_ i - \Delta _ i \log ( \Delta _ i - \hat{M}_ i)]}  \]

When the counting process MODEL specification is used, values of the RESDEV= variable are set to missing because the deviance residuals can be calculated only on a per-subject basis.

The Schoenfeld (1982) residual vector is calculated on a per-event-time basis. At the jth event time $t_{i_ j}$ of the ith subject, the Schoenfeld residual

\[  \hat{\bU }_{i}(t_{i_ j}) = \bZ _{i}(t_{i_ j}) - \bar{\bZ }(\hat{\bbeta },t_{i_ j})  \]

is the difference between the ith subject covariate vector at $t_{i_ j}$and the average of the covariate vectors over the risk set at $t_{i_ j}$. Under the proportional hazards assumption, the Schoenfeld residuals have the sample path of a random walk; therefore, they are useful in assessing time trend or lack of proportionality. Harrell (1986) proposed a z-transform of the Pearson correlation between these residuals and the rank order of the failure time as a test statistic for nonproportional hazards. Therneau, Grambsch, and Fleming (1990) considered a Kolmogorov-type test based on the cumulative sum of the residuals.

The score process for the ith subject at time t is

\[  \bL _{i}(\bbeta ,t) = \int _{0}^{t} [\bZ _{i}(s) - \bar{\bZ }(\bbeta ,s)] dM_{i}(\bbeta , s)  \]

The vector $\hat{\bL }_ i \equiv \bL _ i(\hat{\bbeta },\infty )$ is the score residual for the ith subject. When the counting process MODEL specification is used, the RESSCO= variables contain the components of $(\bL _ i(\hat{\bbeta },t_2) - \bL _ i(\hat{\bbeta },t_1))$ instead of the score process at $t_2$. The score residual for a subject can be obtained by summing up these component residuals within the subject.

The score residuals are a decomposition of the first partial derivative of the log likelihood. They are useful in assessing the influence of each subject on individual parameter estimates. They also play an important role in the computation of the robust sandwich variance estimators of Lin and Wei (1989) and Wei, Lin, and Weissfeld (1989).

For TIES=EFRON, the preceding computation is modified to comply with the Efron partial likelihood. For a given time t, let $\Delta _ i(t)$=1 if the t is an event time of the ith subject and 0 otherwise. Let $d(t)=\sum _ i\Delta _ i(t)$, which is the number of subjects that have an event at t. For $1\leq k \leq d(t)$, let

\begin{eqnarray*}  S^{(0)}(\bbeta ,k, t) & =&  \sum _{i} Y_{i}(t) \biggl \{ 1- \frac{k-1}{d(t)} \Delta _{i}(t) \biggr \} \mr{e}^{\bbeta '\bZ _{i}(t)} \\ S^{(1)}(\bbeta ,k,t) & =&  \sum _{i} Y_{i}(t) \biggl \{ 1- \frac{k-1}{d(t)} \Delta _{i}(t) \biggr \}  \mr{e}^{\bbeta '\bZ _{i}(t)} \bZ _{i}(t) \\ \bar{\bZ }(\bbeta ,k,t) & =&  \frac{ S^{(1)}(\bbeta ,k,t)}{ S^{(0)}(\bbeta ,k,t) } \\ d\Lambda _0(\bbeta ,k,t) &  = &  \sum _ i\frac{dN_ i(t)}{S^{(0)}(\bbeta ,k,t)} \\ dM_ i(\bbeta ,k,t) &  = &  dN_ i(t) - Y_ i(t)\biggl ( 1- \Delta _ i(t) \frac{k-1}{d(t)} \biggr ) \mr{e}^{\bbeta '\bZ _ i(t)} d\Lambda _0(\bbeta ,k,t) \end{eqnarray*}

The martingale residual at t for the ith subject is defined as

\[  \hat{M}_ i(t) = \int _0^ t \frac{1}{d(s)} \sum _{k=1}^{d(s)} dM_ i(\hat{\bbeta },k,s) = N_ i(t) - \int _0^ t \frac{1}{d(s)} \sum _{k=1}^{d(s)} Y_ i(s)\biggl ( 1- \Delta _ i(s) \frac{k-1}{d(s)} \biggr ) \mr{e}^{\hat{\bbeta }'\bZ _ i(s)} d\Lambda _0(\hat{\bbeta },k,s)  \]

Deviance residuals are computed by using the same transform on the corresponding martingale residuals as in TIES=BRESLOW.

The Schoenfeld residual vector for the ith subject at event time $t_{i_ j}$ is

\[  \hat{\bU }_{i}(t_{i_ j}) = \bZ _{i}(t_{i_ j}) - \frac{1}{d(t_{i_ j})}\sum _{k=1}^{d(t_{i_ j})}\bar{\bZ }(\hat{\bbeta },k,t_{i_ j})  \]

The score process for the ith subject at time t is given by

\[  \bL _{i}(\bbeta ,t) = \int _0^ t \frac{1}{d(s)} \sum _{k=1}^{d(s)}\biggl (\bZ _{i}(s) - \bar{\bZ }(\bbeta ,k,s) \biggr ) dM_{i}(\bbeta ,k,s) \\  \]

For TIES=DISCRETE or TIES=EXACT, it is difficult to come up with modifications that are consistent with the corresponding partial likelihood. Residuals for these TIES= methods are computed by using the same formulas as in TIES=BRESLOW.