harrelfe / Hmisc

Harrell Miscellaneous
Other
205 stars 81 forks source link

Behavior of rcorr.cens can be surprising (predictor variable corresponds to survival, not rel. risk) #121

Open aa-m-sa opened 4 years ago

aa-m-sa commented 4 years ago

While computing time-to-event C indexes, I stumbled upon a surprising behavior of rcorr.cens: a pair i,j is concordant with event time pair T_i < T_j if x[i] < x[j]. This is at odds with an alternative quite common formulation where a smaller predictor is concordant with a longer time-to-event.

Minimal working example:

> tstdf
  predictor time status
1         0.9    5      1
2         0.8    6      1
3         0.7    7      1
4         0.6    8      1
> Hmisc::rcorr.cens(tstdf$predictor, Surv(tstdf$time, tstdf$status))
       C Index            Dxy           S.D.              n        missing 
             0             -1              0              4              0 
    uncensored Relevant Pairs     Concordant      Uncertain 
             4             12              0              0

I was expecting C index of 1, because I assumed the "numerical predictor" could be e.g. a relative risk in the Cox model. Maybe clarify documentation?

(edit: clarified lang.)