1
$\begingroup$

I've been developing a Cox Proportional Hazards model, coxPHDC, using the survival package in R. I then tested the proportional hazards assumption with

    cox.zph(coxPHDC)

    zph1 <- cox.zph(coxPHDC, transform = function(time) log(time))

    plot(zph1[2])

and developed the following graph for temperature: enter image description here

As you can see there are non-proportional hazards with temperature in my results. My data is split between two temperatures, 320 C and 340 C, and there look to be two different groups in the graph. Even if these two groups aren't defined specifically along temperature I want to see which points in this graph are 320 C and which are 340 C. How can I code that?

$\endgroup$

1 Answer 1

1
$\begingroup$

The values on the y-axis are the scaled Schoenfeld residuals, available with resid(coxPHDC, "scaledsch"), so you can obtain and plot them separately from plot.cox.zph.

Note that (by definition) there is one scaled Schoenfeld residual per event time, not one per individual. If you have tied events, there isn't a unit mapping from individuals to points.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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