[R] coxph diagnostics plot for shape of hazard function?

Eric Rescorla ekr at rtfm.com
Mon Nov 10 15:54:14 CET 2008


I've been banging my head against the following problem for a while
and thought the fine people on r-help might be able to help. I'm
using the survival package.

I'm studying the survival rate of a population with a preexisting
linear-like event rate (there are theoretical reasons to believe
it's linear, but of course it's subject to the usual sampling noise)

Some of the population exhibit predictor
X and some don't [I'm not trying to be cagey about the setting
here, it's just complicated to explain and I'm trying to keep my
message short.] When I plot the survival curves, there's a qualitatively
significant difference and this is confirmed by survdiff.

When I run cox.zph, however, it's pretty clear that the proportional
hazards assumption isn't satisfied:

> zph <- cox.zph(cox)
> zph
                         rho chisq        p
Initially.Vulnerable -0.0476  32.5 1.19e-08

Similarly, when I do plot(zph), B(t) is fairly non-constant.

This isn't inherently a problem for me. I don't need a hard single number
to characterize the shape of the excess risk. However, I'd like to be
able to say
something qualitative about the shape of the excess risk for the predictor.
E.g., is it linear, monotonically increasing, monotonially decreasing, etc.
Is it safe to use the coxph diagnostic plot for this purpose?

I did try heuristically subtracting out the background and then fitting a spline
using locfit as described in the MASS supplement, but this seemed a little more
ad hoc than I was hoping for something more principled.

Thanks in advance.


More information about the R-help mailing list