3
$\begingroup$

I'm new to survival analysis and am practicing on the AIDS Clinical Trials Group Study 175 Data from the UCI Machine Learning Repository. After using R to fit the Cox PH model, I made a plot to look at the Martingale Residuals and did the ZPH function to test the model assumptions. The Martingale Residual plot looks different than any residual plot I've seen before so I'm a bit confused as to how I should interpret this. The same goes for the zph, I don't get what is going on with the graphs and why the plot points are spread into these three groupings. Thanks!

> # Fit Cox proportional hazards model
> fit <- coxph(Surv(time, target) ~ trt + strata(offtrt), data = dataset)
> summary(fit)
Call:
coxph(formula = Surv(time, target) ~ trt + strata(offtrt), data = dataset)

  n= 2139, number of events= 521 

        coef exp(coef) se(coef)      z Pr(>|z|)    
trt1 -0.6742    0.5096   0.1236 -5.455 4.88e-08 ***
trt2 -0.6458    0.5242   0.1213 -5.323 1.02e-07 ***
trt3 -0.4926    0.6110   0.1157 -4.258 2.07e-05 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

     exp(coef) exp(-coef) lower .95 upper .95
trt1    0.5096      1.962    0.3999    0.6492
trt2    0.5242      1.907    0.4133    0.6650
trt3    0.6110      1.637    0.4871    0.7666

Concordance= 0.584  (se = 0.013 )
Likelihood ratio test= 41.69  on 3 df,   p=5e-09
Wald test            = 44.2  on 3 df,   p=1e-09
Score (logrank) test = 45.59  on 3 df,   p=7e-10

> 
> plot(predict(fit), residuals(fit,type = "martingale"),
+      xlab = "fitted value", ylab = "Martingale Residuals",
+      main = "Residual Plot", las = 1)
> abline(h = 0)
> 
> lines(smooth.spline(predict(fit),
+                     residuals(fit, type = "martingale")), col = "red")
> 
> plot(cox.zph(fit, terms = FALSE))
> 
> 
> cox.zph(fit, terms = FALSE)
        chisq df     p
trt1   1.2956  1 0.255
trt2   3.7209  1 0.054
trt3   0.0046  1 0.946
GLOBAL 8.6163  3 0.035

Text Text

$\endgroup$

1 Answer 1

2
$\begingroup$

The discrete nature of both plots comes from having only categorical predictors in your models.

A martingale residual is the difference between the observed number of events and the expected number of events (based on covariate values) for an individual at an event or right-censoring time. See this page for an outline. Martingale residuals (and their related deviance residuals) shouldn't be thought of in the same way as residuals from least-squares regressions, given the complications due to censoring in survival models. Martingale residuals do have some uses, as in estimating the functional form for a continuous predictor. See this page. I don't think of them as something to check routinely.

The scaled Schoenfeld residuals in the second plot represent the differences between an individual's covariate value at an event time and the risk-weighted average of the covariate values among all those at risk at that time. Again, with only a limited number of covariate values for a categorical predictor, you will have banding like this: at any event time, there is only a small number of possible differences of an individual's value from the risk-averaged value. The smoothed curve illustrates how the apparent regression coefficient for the predictor changes over time. It thus provides information about how well the proportional hazards assumption (PH) is met; under PH with a time-constant regression coefficient (and associated hazard ratio), that smoothed curve should be horizontal. It's thus a good idea to check these plots routinely. See this page for an explanation.

$\endgroup$
1
  • 1
    $\begingroup$ And the global (adjusted for multiple comparisons) test of PH shows evidence of non-PH. Sometimes an accelerate failure time model (log-logistic or log-normal for example) fits better. $\endgroup$ Commented May 5 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.