[R] Coxph and ordered factors

Florent Baty florent.baty at unibas.ch
Wed Feb 21 11:18:23 CET 2007

Dear useRs,

I am trying to fit a Cox PH model on survival data from a lung cancer 
dataset. I would like to include the patient staging (I-IV) as a 
covariate. For this I use the following function:
coxph(Surv(time,status) ~ stage)
The staging information is a categorical variable, and it is important 
to take the ordering into account (I<II<III<IV). Does the coxph function 
handle correctly ordered factors, or is it preferable to recode the 
covariate into numerical values (1-4)?

Thank you very much for your help,


		Dr Florent BATY
Pulmonary Gene Research, Universitätsspital Basel
   Petersgraben 4, CH-4031 Basel, Switzerland
 tel: +41 61 265 57 27 - fax: +41 61 265 45 87

More information about the R-help mailing list