Skip to main content

Competing Risks (Fine–Gray): Will It Be Cancer, or Something Else First?

Competing risks regression in R with survival and cmprsk, on 1,384 people with a blood disorder that may turn into cancer (Mayo Clinic): why one minus Kaplan-Meier is wrong, cumulative incidence by hand, cause-specific hazards with Cox models, the Fine-Gray subdistribution hazard, when the two give opposite answers and what each is for, predicted risks, checks and APA reporting.

The question: two ways to leave

Monoclonal gammopathy (MGUS) is a condition of the blood that many older people have without knowing. It does no harm by itself, but in some it turns into a cancer of the plasma cells (PCM, for example multiple myeloma). Doctors at the Mayo Clinic followed 1,384 patients for up to 35 years (Kyle et al., 2002).

A patient asks: what is my risk of getting the cancer? The difficulty is that the patients are old. Their average age at diagnosis is 70, and many die of something else first. A person who has died of a heart attack will never get the cancer.

When one event makes another impossible, they are competing risks. Common survival methods treat a death as censoring, as if the person had only been lost from sight and might still get the cancer later. That gives a risk for a world in which nobody dies of anything else. It is far too high, and it is a frequent mistake in medical papers.

This page shows the right way to describe the risk, and the two regressions for it: cause-specific hazards, and the Fine–Gray model. They can give opposite answers about the same predictor, and both can be right.

Code
library(survival)   # survfit(), coxph(), finegray(); the data (comes with R)
library(cmprsk)     # crr(): the Fine-Gray model, as in the original paper
library(ggplot2)

event_colours <- c(`cancer (PCM)` = "#eb6834", `death without cancer` = "#2a78d6")

# number formats for the text
f1   <- function(x) formatC(x, format = "f", digits = 1, big.mark = ",")
f2   <- function(x) formatC(x, format = "f", digits = 2, big.mark = ",")
f3   <- function(x) formatC(x, format = "f", digits = 3, big.mark = ",")
# no leading zero
nz <- function(x, d = 2) sub("^(-?)0", "\\1", formatC(x, format = "f", digits = d))
pval <- function(p) if (p < .001) "< .001" else paste("=", nz(p, 3))
num  <- function(x) trimws(format(x, big.mark = ","))
pct  <- function(x, d = 1) paste0(formatC(100 * x, format = "f", digits = d), "%")

1. The data

The data come with R, in the package survival:

Code
mgus <- subset(mgus2, !is.na(mspike))
# years until the first event, or the end
mgus$time <- with(mgus, ifelse(pstat == 1, ptime, futime)) / 12
mgus$event <- factor(
  with(mgus, ifelse(pstat == 1, 1, 2 * death)),
  0:2,
  c("censored", "PCM", "death")
)
mgus <- subset(mgus, time > 0)
mgus$age10 <- (mgus$age - 70) / 10; mgus$male <- as.integer(mgus$sex == "M")
nrow(mgus)
[1] 1373
Code
table(mgus$event)

censored      PCM    death 
     404      115      854 
Code
c(mean_age = mean(mgus$age), longest_follow_up = max(mgus$time))
         mean_age longest_follow_up 
         70.45521          35.33333 

Each patient has one first event: the cancer (PCM), or death without it, or neither until the end of the study (censored). age10 is the age at diagnosis in decades from 70, male the sex, and mspike the size of the abnormal protein in the blood (grams per deciliter), which is known to predict the cancer. Of 1,373 patients, 115 got the cancer, 854 died without it. (The other 11 of the 1,384 are left out, because their M-spike was not measured.)


2. One minus Kaplan–Meier is wrong

The tempting calculation: call the cancer the event, treat deaths as censored, and take one minus the Kaplan–Meier curve.

Code
km <- survfit(Surv(time, event == "PCM") ~ 1, data = mgus) # deaths treated as censored: wrong
cif <- survfit(Surv(time, event) ~ 1, data = mgus) # event is a factor with several outcomes: right
at  <- c(5, 10, 20, 25)
risk <- rbind(`1 - Kaplan-Meier`        = 1 - summary(km, times = at)$surv,
              `cumulative incidence`    = summary(cif, times = at)$pstate[, 2],
              `death without cancer`    = summary(cif, times = at)$pstate[, 3])
colnames(risk) <- paste(at, "years"); round(risk, 3)
                     5 years 10 years 20 years 25 years
1 - Kaplan-Meier       0.042    0.096    0.210    0.261
cumulative incidence   0.034    0.064    0.100    0.110
death without cancer   0.319    0.532    0.723    0.762
Code
curves <- rbind(
  data.frame(time = km$time, risk = 1 - km$surv, what = "1 − Kaplan–Meier (deaths as censored)"),
  data.frame(time = cif$time, risk = cif$pstate[, 2], what = "cumulative incidence of the cancer")
)
ggplot(curves, aes(time, risk, colour = what)) +
  geom_step(linewidth = 1) +
  scale_colour_manual(values = c("grey55", "#eb6834"), name = NULL) +
  scale_y_continuous(labels = function(v) paste0(100 * v, "%")) +
  coord_cartesian(xlim = c(0, 30)) +
  labs(
    title = "Two answers to: what is the risk of the cancer?",
    x = "years since diagnosis",
    y = NULL
  ) +
  theme_bw() +
  theme(legend.position = "bottom")

Naive chart – 2. One minus Kaplan–Meier is wrong

After 25 years the first method says 26.1%, and the truth about these patients is 11.0%. The difference is the patients who died: 76.2% of them in 25 years. Kaplan–Meier assumes that they would have got the cancer at the same rate as the survivors, if they had only lived. They did not live. The Kaplan–Meier answer is about an imaginary world, and even there only if those who died and those who did not had the same risk, which nobody can check.


3. The model step by step, with formulas

Step 1: cause-specific hazards

For each event \(k\) there is a hazard: the rate of this event among those who have had none of them yet,

\[h_k(t) = \text{rate of event } k \text{ at } t, \text{ given no event before } t\]

Step 2: cumulative incidence

The cumulative incidence of event \(k\) is the probability of having had it by time \(t\):

\[F_k(t) = \int_0^t S(u)\, h_k(u)\, du\]

where \(S(u)\) is the probability of still being free of any event. At each moment, the share still free, times the rate of event \(k\). So the risk of the cancer depends on both hazards: a high rate of death empties the pool. The sum of all the cumulative incidences and of those still free is 1.

By hand (the Aalen–Johansen estimate):

Code
times <- sort(unique(mgus$time)); S <- 1; F1 <- F2 <- 0; out <- NULL
for (t in times) {
  at_risk <- sum(mgus$time >= t)
  d1 <- sum(mgus$time == t & mgus$event == "PCM")
  d2 <- sum(mgus$time == t & mgus$event == "death")
  F1 <- F1 + S * d1 / at_risk
  F2 <- F2 + S * d2 / at_risk # the share still free just before t, times the two rates
  S <- S * (1 - (d1 + d2) / at_risk)
  out <- rbind(out, c(t, F1, F2, S))
}
i <- max(which(out[, 1] <= 20))
c(
  by_hand = out[i, 2],
  survfit = summary(cif, times = 20)$pstate[, 2],
  sum_of_all_three = sum(out[i, 2:4])
)
         by_hand      survfit.PCM sum_of_all_three 
       0.1002904        0.1002904        1.0000000 

Step 3: two kinds of regression

Cause-specific. A Cox model for each event, with the other event as censoring. Its hazard ratios are about rates among those still free: how does \(x\) act on the process?

Fine–Gray. A model directly for the cumulative incidence. Fine and Gray (1999) defined a subdistribution hazard, whose relation to \(F_k\) is the usual one, \(1 - F_k(t) = \exp\{-\int_0^t \tilde h_k(u)\,du\}\), and put a proportional model on it:

\[\tilde h_k(t \mid x) = \tilde h_{k0}(t)\, e^{x^\top\beta}\]

The trick is who is at risk: in the subdistribution, those who died stay in the risk set, for ever, with no chance of the event. It sounds absurd, and it is a bookkeeping device. If many die early, they stay in the denominator and keep the risk low, as it is in reality. If \(\beta > 0\), the cumulative incidence is higher. That is all its coefficients say; they are not effects on a rate among people who could have the event.

Step 4: with censoring

People who die stay in the risk set, but for how long would they have been followed? Fine and Gray give them a weight that falls with time, the probability of not yet having been censored. finegray() builds the data set with these weights, and an ordinary Cox model with weights does the rest.


4. The regressions

Code
# cause-specific: the cancer
cs_pcm <- coxph(Surv(time, event == "PCM") ~ age10 + male + mspike, data = mgus)
# cause-specific: death
cs_death <- coxph(Surv(time, event == "death") ~ age10 + male + mspike, data = mgus)

fg_data <- finegray(Surv(time, event) ~ ., data = mgus, etype = "PCM") # the weighted data set
fg_pcm <- coxph(
  Surv(fgstart, fgstop, fgstatus) ~ age10 + male + mspike,
  weights = fgwt,
  data = fg_data
)
fg_dead  <- finegray(Surv(time, event) ~ ., data = mgus, etype = "death")
fg_death <- coxph(
  Surv(fgstart, fgstop, fgstatus) ~ age10 + male + mspike,
  weights = fgwt,
  data = fg_dead
)
crr_pcm <- crr(
  mgus$time,
  as.integer(mgus$event) - 1,
  as.matrix(mgus[, c("age10", "male", "mspike")]),
  failcode = 1,
  cencode = 0
)
c(rows_before = nrow(mgus), rows_after_finegray = nrow(fg_data))
        rows_before rows_after_finegray 
               1373               41174 
Code
round(rbind(finegray_coxph = coef(fg_pcm), crr = crr_pcm$coef), 4)
                 age10    male mspike
finegray_coxph -0.1690 -0.2134 0.8884
crr            -0.1694 -0.2136 0.8885

The two programs for the Fine–Gray model agree. Now all the hazard ratios in one table:

Code
hr <- function(m) { ci <- exp(confint(m)); cbind(HR = exp(coef(m)), low = ci[, 1], high = ci[, 2]) }
all_hr <- rbind(
  data.frame(
    term = c("age (10 years)", "male", "M-spike (g/dl)"),
    event = "cancer",
    model = "cause-specific",
    hr(cs_pcm)
  ),
  data.frame(
    term = c("age (10 years)", "male", "M-spike (g/dl)"),
    event = "cancer",
    model = "Fine–Gray",
    hr(fg_pcm)
  ),
  data.frame(
    term = c("age (10 years)", "male", "M-spike (g/dl)"),
    event = "death",
    model = "cause-specific",
    hr(cs_death)
  ),
  data.frame(
    term = c("age (10 years)", "male", "M-spike (g/dl)"),
    event = "death",
    model = "Fine–Gray",
    hr(fg_death)
  )
)
print(
  transform(all_hr, HR = round(HR, 2), low = round(low, 2), high = round(high, 2)),
  row.names = FALSE
)
           term  event          model   HR  low high
 age (10 years) cancer cause-specific 1.18 1.00 1.39
           male cancer cause-specific 0.99 0.69 1.44
 M-spike (g/dl) cancer cause-specific 2.42 1.75 3.35
 age (10 years) cancer      Fine–Gray 0.84 0.76 0.94
           male cancer      Fine–Gray 0.81 0.57 1.15
 M-spike (g/dl) cancer      Fine–Gray 2.43 1.82 3.25
 age (10 years)  death cause-specific 1.92 1.79 2.06
           male  death cause-specific 1.48 1.29 1.69
 M-spike (g/dl)  death cause-specific 0.94 0.83 1.07
 age (10 years)  death      Fine–Gray 1.80 1.69 1.93
           male  death      Fine–Gray 1.45 1.29 1.63
 M-spike (g/dl)  death      Fine–Gray 0.86 0.77 0.95
Code
get <- function(term, event, model, col = "HR") {
  all_hr[all_hr$term == term & all_hr$event == event & all_hr$model == model, col]
}
Code
all_hr$label <- factor(all_hr$term, levels = rev(unique(all_hr$term)))
ggplot(all_hr, aes(HR, label, colour = model)) +
  geom_vline(xintercept = 1, linetype = "dashed", colour = "grey50") +
  geom_pointrange(
    aes(xmin = low, xmax = high),
    position = position_dodge(width = 0.5),
    linewidth = 0.8
  ) +
  facet_wrap(~event) +
  scale_x_log10(breaks = c(0.6, 0.8, 1, 1.5, 2, 3)) +
  scale_colour_manual(
    values = c(`cause-specific` = "#2a78d6", `Fine–Gray` = "#eb6834"),
    name = NULL
  ) +
  labs(title = "Hazard ratios from the two models", x = "hazard ratio (log scale)", y = NULL) +
  theme_bw() +
  theme(legend.position = "bottom")

Hr chart – 4. The regressions

Read age in the panel of the cancer.

  • Cause-specific: HR = 1.18, 95% CI [1.00, 1.39]. Among people who are alive and free of cancer, the rate is if anything a little higher in older ones.
  • Fine–Gray: HR = 0.84, [0.76, 0.94]. The risk of ever getting it is clearly lower in older people.

Both are right. Ten years more multiply the rate of death by 1.92. Older people are not protected from the cancer. They have less time to get it.

The protein (mspike) acts on the cancer itself: 2.42 and 2.43 are nearly the same, because it hardly changes the rate of death (0.94). In the Fine–Gray model for death its ratio is 0.86: a larger protein “protects” from dying without cancer. Not because it keeps people alive, but because more of them get the cancer first.


5. Which one to use?

Question Model
Why does it happen? Does \(x\) act on the biological process? (etiology, effect of a treatment on the disease) Cause-specific hazards, for all the events
How many will have it? What is the risk of this patient? (prognosis, planning, costs) Cumulative incidence; Fine–Gray, or predictions from the cause-specific models together

This division of labor is the usual advice (Austin et al., 2016; Lau et al., 2009). Latouche et al. (2013) recommend to report both: the cause-specific hazards of all the events, and the cumulative incidences. One without the others can mislead, as the two results for age show. In particular, never report a Fine–Gray ratio as an effect on the disease.


6. Predicted risks

The two routes to the risk of one patient: from the Fine–Gray model directly, and from the two cause-specific models, put together with the formula of step 2 (a multi-state model; survfit() does it).

Code
new <- data.frame(age10 = c(-1, 1, -1, 1), male = 1, mspike = c(0.5, 0.5, 2, 2))
new$who <- c(
  "60 years, M-spike 0.5", "80 years, M-spike 0.5", "60 years, M-spike 2", "80 years, M-spike 2"
)
sf_fg <- survfit(fg_pcm, newdata = new)
# both cause-specific models at once
multi <- coxph(Surv(time, event) ~ age10 + male + mspike, data = mgus, id = id)
sf_cs <- survfit(multi, newdata = new)
risk_at <- function(t) {
  data.frame(
    who = new$who,
    FineGray = 1 - summary(sf_fg, times = t)$surv[1, ],
    cause_specific = summary(sf_cs, times = t)$pstate[1, , 2],
    death_first = summary(sf_cs, times = t)$pstate[1, , 3]
  )
}
r20 <- risk_at(20)
print(cbind(who = r20$who, round(r20[, -1], 3)), row.names = FALSE)
                   who FineGray cause_specific death_first
 60 years, M-spike 0.5    0.052          0.059       0.659
 80 years, M-spike 0.5    0.038          0.032       0.956
   60 years, M-spike 2    0.185          0.205       0.560
   80 years, M-spike 2    0.136          0.120       0.868
Code
pd <- do.call(
  rbind,
  lapply(1:4, function(j) {
    rbind(
      data.frame(
        who = new$who[j],
        time = sf_cs$time,
        p = sf_cs$pstate[, j, 2],
        event = "cancer (PCM)"
      ),
      data.frame(
        who = new$who[j],
        time = sf_cs$time,
        p = sf_cs$pstate[, j, 3],
        event = "death without cancer"
      )
    )
  })
)
pd$who <- factor(pd$who, levels = new$who)
ggplot(pd, aes(time, p, fill = event)) +
  geom_area(alpha = 0.75) +
  facet_wrap(~who) +
  scale_fill_manual(values = event_colours, name = NULL) +
  scale_y_continuous(labels = function(v) paste0(100 * v, "%")) +
  coord_cartesian(xlim = c(0, 25)) +
  labs(
    title = "Four men: what will have happened?",
    subtitle = "The rest, up to 100%, is alive without cancer",
    x = "years since diagnosis",
    y = NULL
  ) +
  theme_bw() +
  theme(legend.position = "bottom")

Predictions chart – 6. Predicted risks

A man of 60 with a large protein has a 20-year risk of the cancer of 21%; a man of 80 with the same protein, 12%, because 87% of such men die of something else within 20 years. The two routes agree to within 2.0 points.


7. Checking the model

Code
rbind(
  cause_specific_PCM = cox.zph(cs_pcm)$table[, "p"],
  cause_specific_death = cox.zph(cs_death)$table[, "p"],
  fine_gray_PCM = cox.zph(fg_pcm)$table[, "p"]
)
                            age10      male    mspike       GLOBAL
cause_specific_PCM   9.359611e-02 0.6266840 0.8992740 3.867087e-01
cause_specific_death 1.149011e-08 0.3447954 0.5521883 1.903550e-07
fine_gray_PCM        5.064391e-06 0.6208059 0.7698267 1.036011e-04

Proportional hazards can be checked for each model in the usual way. If the cause-specific hazards are proportional, the subdistribution hazards in general cannot be, and the other way round: the two models cannot both be exactly right. In practice both are approximations. That is what we see. For the cause-specific hazard of the cancer no predictor fails. For death, age does: its effect on mortality changes over 30 years of follow-up, as one would expect. And in the Fine–Gray model age fails as well: the subdistribution hazard mixes the two processes, and the competing deaths of the old come at other times than those of the young. Its single ratio for age is an average over the follow-up. For the risks of section 6, where this could matter, the two routes gave similar answers.


8. Things to keep in mind

  • Decide what the events are before the analysis, and make them complete: everybody has exactly one first event, or is censored.
  • Censoring and competing events are not the same. A censored person may still have the event, outside our view. A person with a competing event may not.
  • Combined endpoints (cancer or death) avoid the problem, and answer another question.
  • Few events. With 115 cancers there is room for a few predictors only.
  • The Fine–Gray hazard ratio is not a ratio of risks either. An HR of 0.83 does not mean 17% less risk; report the cumulative incidences.
  • Time-dependent predictors do not work in Fine–Gray models: after a death they have no value.
  • In trials, a treatment that kills people early can “reduce” the incidence of everything else. Always look at all the causes.

9. Reporting the results in APA style

A report (APA 7th edition) needs the events and their numbers, cumulative incidences, the cause-specific hazard ratios of all the events, and, for prognosis, the subdistribution hazard ratios, clearly labeled. The numbers come from the R objects:

Code
cell <- function(e, m) {
  sapply(c("age (10 years)", "male", "M-spike (g/dl)"), function(t) {
    paste0(f2(get(t, e, m)), " [", f2(get(t, e, m, "low")), ", ", f2(get(t, e, m, "high")), "]")
  })
}
apa_table <- data.frame(
  Predictor = c("Age (10 years)", "Male", "M-spike (g/dl)"),
  a = cell("cancer", "cause-specific"),
  b = cell("death", "cause-specific"),
  c = cell("cancer", "Fine–Gray"),
  row.names = NULL
)

Method (data analysis):

We followed 1,373 patients with monoclonal gammopathy (Kyle et al., 2002) until progression to a plasma cell malignancy, death without it, or the end of the study. Death was treated as a competing event. Cumulative incidences were estimated with the Aalen–Johansen method. Cause-specific hazards of both events were analyzed with Cox models, and the cumulative incidence of malignancy with the Fine–Gray subdistribution hazard model (Fine & Gray, 1999); predictors were age, sex and the size of the M-spike. Analyses were conducted in R (Version 4.6.2; R Core Team, 2026) with the packages survival and cmprsk.

Results:

During follow-up 115 patients progressed to a malignancy and 854 died without it. The cumulative incidence of malignancy was 6.4% after 10 and 10.0% after 20 years (one minus the Kaplan–Meier estimate, which treats deaths as censored, would be 21.0% after 20 years), and that of death without malignancy 72.3% after 20 years. A larger M-spike was associated with a higher rate of malignancy, cause-specific HR = 2.42, 95% CI [1.75, 3.35]. Older patients had a slightly higher rate, HR = 1.18 per 10 years, 95% CI [1.00, 1.39], but a lower cumulative incidence, subdistribution HR = 0.84, 95% CI [0.76, 0.94], because of their higher mortality (Table 1).

Table 1

Competing Risks Models of Malignancy and Death

Predictor Malignancy: cause-specific HR Death: cause-specific HR Malignancy: subdistribution HR
Age (10 years) 1.18 [1.00, 1.39] 1.92 [1.79, 2.06] 0.84 [0.76, 0.94]
Male 0.99 [0.69, 1.44] 1.48 [1.29, 1.69] 0.81 [0.57, 1.15]
M-spike (g/dl) 2.42 [1.75, 3.35] 0.94 [0.83, 1.07] 2.43 [1.82, 3.25]

Note. N = 1,373. Hazard ratios with 95% confidence intervals.

Points to remember:

  • Never report one minus Kaplan–Meier as a risk when there are competing events.
  • Report the numbers of all the events.
  • Give the cause-specific hazard ratios of all the events.
  • Call Fine–Gray ratios subdistribution hazard ratios, and use them for risk, not for causes.

10. Summary

When A first event of several kinds, where one prevents the others
Describe with Cumulative incidence: survfit(Surv(time, event) ~ 1), with event a factor whose first level is censoring
Not with 1 − Kaplan–Meier (too high)
Rates Cause-specific Cox models, one per event
Risks Fine–Gray: finegray() + coxph(..., weights = fgwt), or cmprsk::crr()
They differ when A predictor acts on the competing event
Predicted risk From all the cause-specific models together, or from Fine–Gray
Related pages Cox, Weibull and AFT

References

Austin, P. C., Lee, D. S., & Fine, J. P. (2016). Introduction to the analysis of survival data in the presence of competing risks. Circulation, 133(6), 601–609. https://doi.org/10.1161/CIRCULATIONAHA.115.017719

Fine, J. P., & Gray, R. J. (1999). A proportional hazards model for the subdistribution of a competing risk. Journal of the American Statistical Association, 94(446), 496–509. https://doi.org/10.1080/01621459.1999.10474144

Kyle, R. A., Therneau, T. M., Rajkumar, S. V., Offord, J. R., Larson, D. R., Plevak, M. F., & Melton, L. J., III. (2002). A long-term study of prognosis in monoclonal gammopathy of undetermined significance. The New England Journal of Medicine, 346(8), 564–569. https://doi.org/10.1056/NEJMoa01133202

Latouche, A., Allignol, A., Beyersmann, J., Labopin, M., & Fine, J. P. (2013). A competing risks analysis should report results on all cause-specific hazards and cumulative incidence functions. Journal of Clinical Epidemiology, 66(6), 648–653. https://doi.org/10.1016/j.jclinepi.2012.09.017

Lau, B., Cole, S. R., & Gange, S. J. (2009). Competing risk regression models for epidemiologic data. American Journal of Epidemiology, 170(2), 244–256. https://doi.org/10.1093/aje/kwp107