Solved – Goodness of fit – Testing Cox proportional hazard assumption in R

I am performing survival analysis on credit data. I created a simple model with using interest rate:
cox <- coxph(Surv(periods,charged_off) ~ int_rate, data=notes)
I assumed that int_rate was a time-independent variable, but the following test rejects HA:

> cox.zph(cox)             rho chisq        p int_rate 0.0446  14.2 0.000169 

Same result for other variables such as loan amount:

> cox <- coxph(Surv(periods,charged_off) ~ int_rate + loan_amnt, data=notes) > cox.zph(cox)              rho chisq        p int_rate  0.0364  9.31 2.28e-03 loan_amnt 0.0317  8.84 2.95e-03 GLOBAL        NA 26.28 1.97e-06 

Plot for int_rate:

enter image description here

Why would these covariates be considered time dependent? Am I doing something wrong? Thanks.

The distinction one has to make is between time-varying covariate and a covariate whose coefficient changes over time. Both violate the proportionality assumption, but do not have to be drawbacks. Rather, they can and are often theoretically meaningful (see Singer & Willett's book on Longitudinal Data Analysis and their 1991 paper in Psychological Bulletin). They just have to be included in the model.

In your plot, it looks like the coefficient for that time-invariant predictor changes over time (becomes less strong) and therefore violates the proportionality assumption. Including an interaction with that covariate and time would solve things and get around the proportionality assumption. Again, Singer and Willett's book is a classic–and highly accessible. The companion website also has code and examples for software implementation.

Similar Posts:

Rate this post

Leave a Comment