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