12-05-2016 06:39 PM - edited 12-06-2016 01:03 PM
I want to plot a survival curve for competing risk but I cannot find out how it is implememted in SAS. I want survival curve S(t), not the cumullative infidence function. If anyone happen to know how to implement this, please let me know. Thank you very much!
Here is what I have tried:
(1) I tried "proc phreg"
proc phreg data=mm(where=(time_to_event_year < 30)) plots(overlay=stratum)=survival;
class group(order=internal);* ref=first);
model time_to_event_year*death_status(0)=group / eventcode=1;
Hazardratio 'Pairwise' group / diff=pairwise;
baseline covariates=Risk out=out1 cif=_all_ / seed=191;
I got an error message:
ERROR: Cannot request a SURVIVAL plot for the Fine and Gray competing-risks analysis.
(2) I also tried "proc lifetest"
proc lifetest data=mm(where=(time_to_event_year < 30)) plots=survival;
time time_to_event_year*death_status(0) / eventcode=1;
strata group / order=internal;
Again, I got error message that "/ eventcode = 1" cannot be recoganized and ignored. However, when I checked the lifetest procedure, this is an option.
It would be great if anyone can help! Thanks again.
12-05-2016 09:46 PM
Hi and welcome to the community!
In checking the SAS Stat User's Guide (Version 14.1), there isn't an / errorcode= option. The closest I see is error= but the only options are AALEN and DELTA.
If you have access to SAS ODS, I recommend using the SAS ODS Graphics Designer (See Example 6) as it assists you in building your graph and you can the save the code and modify it in your SAS Editor.
If you can provide the link to the documentation you were using, it would help (possibly an option that has since been deprecated?).
Good luck and post back what you find out!
12-05-2016 09:54 PM
12-06-2016 01:50 AM
Eventcode = has a small section in the doc
specifies the number that represents the event of interest for the competing-risks analysis of Fine and Gray (1999). For example:
model T*Status(0 1)= X1-X5 / eventcode=2;
This specifies that a subject whose Status value is 2 has the event of interest, a subject whose Status value is 0 or 1 is a censored observation, and a subject that has another value of the Status variable has a competing event.
@xlsemi135 If you don't get an answer soon, I would recommend searching lexjansen.com. I suspect this is a common request and it would have the code on how to achieve this.
12-06-2016 01:55 AM
FYI - I suspect there's a methodological reason for not generating a survival curve, but using a CiF instead.
Unfortunately it's been 5 years since I last did survival analysis.
12-06-2016 12:54 PM
When I googled competing risk survival analyses, CIF plots are generated and the surival plots are not mentioned. It would be great to know why survival function is not used for competing risk? It appears that the competing event can be adjusted by excluding them from the denominator?
If it would be greate if you can find the reference you are referrring to. Thanks.
12-06-2016 06:34 AM
@Reeza I'm constantly impressed by your breadth and depth of knowledge. Always learning from you :-)
hope all is well and chat soon
12-06-2016 12:56 PM
12-06-2016 01:02 PM
12-06-2016 02:44 PM
Survival plots are biased when you have competing risks, the CIF is used instead.
If you want survival plots regardless you may need to recode your data. Proc lifetest is non parametric and does not deal with competing risks AFAIK.
12-06-2016 12:49 PM
That's OK. The time*status(0) is not for competing risk.
You can find this topic in the following page:
They used the following code in lifetest:
proc lifetest data=bmt plots=cif(test ); time Dftime*Status(0)/eventcode=1; strata Gender/group=Disease order=internal; format Disease diseaseLabel. Gender genderLabel.; run;