# Comparing multiple cumulative incidence functions in the presence of competing risks

I have a survival/duration dataset with competing risks. The start years for the durations vary and range from 2010 to 2019. Each individual may only start once, e.g. during 2010, and therefore cannot be in the risk groups of the other years. Follow-up ends after 200 days, i.e. the individuals are treated as censored, if they did not transition within 200 days after they became at risk. They are exposed to 3 competing risks, e.g. A, B and C. Using this data, I can calculate cumulative incidence functions (CIF).

If I want to test for differences between the CIF's of one risk, say risk B, but for different years, then there are multiple options. Gray's K-sample test is the most frequently used, but I could also use the Log-rank test or a test invented by Pepe and Mori (1993).

Pairwise testing, whether or not the CIF's of risk B in the pairs of years (2010, 2011), (2011, 2012), (2012, 2013) etc. differ significantly from each other, always yields significant results. Testing all years together using Gray's K-sample test also always results in significant results. When plotting the CIF's of risk B, the distances between the lines for the adjacent years, e.g. 2010 and 2011 compared to 2011 and 2012, appear fairly similar in their size and direction. This suggests, that there may be a trend, which leads to fewer and fewer observations of risk B over time.

Now to my question: Is there a way to test whether or not the difference between the CIF's of risk B of the pair of years (2010, 2011) is the same as the difference between the CIF's of risk B of the pair of years (2011, 2012)?

Naturally, searching for "testing for difference of differences" yielded rather unrelated results. I thought about some other approaches:

1. I could calculate the difference between two CIF's and compare this to the difference between two other CIF's, but I don't which test to apply.
2. Applying a competing risk regression with dummy variables for each year, with 2009 as the reference year, and then testing for Beta_2011 - Beta_2012 = Beta_2012 - Beta_2013 and analogously for the other pairs of years also crossed my mind, but I genuinely have no clue how the test statistic would have to be calculated.
3. Adding a trend trend variable to the regression with the year dummy variables. If none of the year dummies is significant, and only the trend variable matters, this would indicate, that the differences between the years are not due to the years differing from each other per sé, but due to a strong trend.

Any input will be appreciated!

• Do you have actual calendar start dates for each individual, or only the year during which each individual started?
– EdM
Commented May 14, 2022 at 17:39
• Each individual has a known calendar start date, e.g. 25 Feb. 2012, such that the durations can be calculated accurately. The durations range from 1 to 200 days. Commented May 15, 2022 at 16:29

The competing risks vignette of the R survival package covers the issues in Section 3. You will have to make some decisions based on your understanding of the subject matter. In particular: do you want the same functional form of association with study entry date for all risks, or do you want to allow that to differ among the risks?
• @kEngelaar you can use survfit() to get full survival curves for specified covariate values. I believe that the mstate package has helper tools for that sort of thing. See, for example, its msfit() function. With the variances and covariances of estimates, you can use the formula for the variance of a sum of correlated variables to make any comparisons that you wish. As these are asymptotic estimates, you use z-tests that assume they follow a normal distribution.