competing risk analysis in SAS


our data is a like this:

surgery_date is the start point.

I want to use cox regression to predict the time to readmission, death is a competing risk.

so I created a variable competing_outcome: 0=no death and no readmission, 1=readmission, 2=no readmission but dead
so the above 4 people will be:


I am a little confused now about how to form the time
In the codes below:

proc phreg data=ourdata;
class gender /para=ref ref=first;
model time_to_event * competing_outcome(0) = gender/eventcode=1;

Does the time_to_event = the "readmission_date" - "surgery_date" if competing_outcome =1;
and = "dead_date" - "surgery_date" if competing_outcome =2;
and = "lastfollowupdate" - "surgery_date" if competing_outcome =0; ??????????????????????
Last edited: