wanr@ucalgary.ca
2004-Sep-09 20:13 UTC
[R] How to plot the estimated age-specific cumulative risk function?
The hypothetical data is displayed as follows. ID Age1 cens1 Age2 cens2 1 81 0 85 1 2 42 1 48 0 3 37 1 55 0 4 54 0 56 0 5 35 0 37 0 6 38 0 38 1 7 29 0 30 0 8 40 0 40 1 where Age1 is the event time for a disease; cens1 is the censor variable for the disease (1=hold the disease); Age2 is the event time for death (in years); cens2 is the censor variable for death (1=died). First, I might use surv.obj <- survfit(); then I could get estimated cumulative risk function (cdf) by 1 - surv.obj$surv. However, it is tedious to plot this cdf in usual way. My question is whether there exit some specific functions to plot this cdf easily and whether I can set the horizontal axis as individul's age. I am a beginner in survival analysis and I might not state my questions clear enough. Thanks for your understanding and help in advance. Rui