[R] Coxph and ordered factors

Terry Therneau therneau at mayo.edu
Wed Feb 21 20:43:13 CET 2007


 No, coxph does not have any special code to deal with ordered factors.
 You can do it "by hand" by using the pool-adjacent-violators algorithm
    1. Fit the data with stage as a categorical
    2. Verify that the coefficients are ordered
       if so, you are done
       if not, assume that they were
       	     0 = stage 1  (implicit coef)
       	     .1= stage 2
       	     .5 = stage 3
       	     .4 = stage 4
       	  Create a new class variable that combines stages 3 and 4, and
       	  return to step 1.
       	  
       	  
       	  Terry Therneau



More information about the R-help mailing list