# How to understand the plotting of the cox.zph function in R?

I use a Cox proportional hazard model (coxph()) which gives me HR of about 2.9 for presence of factor B (factors can be A, B, C, A as baseline in the model), with 95% CI 1.8-4.8 , p<0.001.

When checking the proportionality assumption there is significant evidence that there is a violation of that assumption.

Result of plot(cox.zph) for the model with factor A is shown below.

My question is how should I understand the smoothing line of the graph, and what is its relation (and the relation of the values on the y-axis) to the beta estimate the coxph() function gives me (2.9 for the above example)?

If there was no violation and the line of the cox.zph plot was straight, would the y-value of the line be (in this example) log(2.9)=0.46? If there is no violation of the proportionality assumption, does the "intercept" of the line equal the log of the HR that coxph() outputs?

-

The curve is a natural spline fit (by default, with 4 degrees of freedom) of the time varying estimates of beta (the log of the hazard ratio). If that line is fairly flat and straight, then proportionality is supported. The dashed lines are confidence intervals at two standard errors. See the help pages for cox.zph and plot.cox.zph for some more information.

-
thanks but i have already done this. I think my question is, IF theoretically the line was straight, would the y-value of the line be (in this example) log(2.9)=0.46? If there is no violation of the proportionality assumption, does the "intercept" of the line equal the log of the HR that the coxph outputs? –  user6143 Sep 2 '11 at 16:39
I believe so, but the line would be at ln(2.9)=1.06 (natural log, not base 10 log). –  Brian Diggs Sep 2 '11 at 17:20
In the context of R/S+ programming, which this clearly is, your advice about using ln instead of log is misleading. –  DWin Feb 8 '12 at 22:13
@DWin, in terms of code, you are correct; I probably should not have marked that up as code. I was using $\ln$ as a base $e$ logarithm in contrast to $\log$ as a base 10 logarithm. In R, the mathematical function $\ln$ is log(). So it should either have been $\ln(2.9)=1.06$ or log(2.9) which gives [1] 1.064711 –  Brian Diggs Feb 10 '12 at 15:16