I downloaded the "cmprsk" package and the "Cumincidence.R" (http://www.stat.unipg.it/luca/misc/CumIncidence.R) in order to create cumulative incidence plots.
This worked out fine. I used these commands:
status=factor(status, levels=c(0:2), labels=c("censored", "TRM", "REL"))
abc=factor(abc, levels=c(0,1), labels=c("A", "B"))
fit=CumIncidence(ftime, status, abc, cencode= "censored", xlab = "years")
and I receive the plot attached.
But how can I only display the plots of "TRM" or of "REL", so only the red ones or only the black ones and not all together?
Thank you for your help!