I have several cumulative incidence curves showing the incidence of an outcome after an exposure, plotted on the same graph, stratified by age at exposure.
The longest follow-up period is 25 years, but in the oldest group, the follow-up does not last any longer than 15 years (as they are all dead by then).
When I plot the cum inc curves, the curve for the oldest group 'flatlines' after 15y, but does not disappear until the 25y point, when all the other curves also disappear (i.e the plot ends).
Is there a way to stop a cumulative incidence curve being plotted when there is nobody at risk, even if other curves for different groups on the same graph go on for longer than the point you wish to stop plotting at for that one problematic curve?
I did this with the surv_fit function in R.