Skip to content
AITroveRead. Build. Understand.
Make this comfortable

Competing risks and resolution incidence

Last updated: 5 Oct 20265 min read
tutorial
IntermediateBy AITrove Editorial

A competing event prevents the event of interest from occurring in the observed workflow; cumulative incidence tracks each outcome without pretending competing exits are ordinary censoring.

Separate possible endings

Suppose a support case can resolve, be cancelled, or remain open at extraction. Resolution and cancellation are terminal outcomes in the recorded workflow. An open case is administratively censored. If cancellation permanently rules out later resolution of that same case, it is a competing event. A different business question—what resolution time might have been if cancellation were impossible—needs stronger causal assumptions and cannot be answered by relabelling cancellations as censored.

Update the event-free share first

At each day use the risk set immediately before any outcome at that day. Let Sprev be the share still free of both terminal events. Add Sprev times resolution count divided by at risk to the resolution cumulative incidence, and similarly for cancellations. Then multiply Sprev by one minus total terminal events divided by at risk. Remove censors after this tied-time calculation. Risk-set discipline keeps the denominator consistent.

Check a small ledger

Six cases have outcomes at day two (one resolution), day three (one cancellation and one censor), day five (one resolution), and day seven (one resolution and one cancellation). The resolution cumulative incidence is 1/6 at day two, 7/18 at day five and 11/18 at day seven. Cancellation incidence finishes at 7/18. They sum to one because this small ledger eventually records a terminal event for every noncensored survivor; the day-three censor itself added to neither incidence.

Interpret the difference from Kaplan–Meier

If cancelled cases are instead treated as censored in a resolution-only Kaplan–Meier calculation, the estimator describes a different hypothetical setting and can produce a higher resolution probability than the observed-world cumulative incidence. State which quantity answers the decision. A queue owner deciding how many cases will actually resolve before day seven needs resolution cumulative incidence with cancellations included, not a hypothetical no-cancellation curve.

Keep uncertainty and policy visible

A cancellation code may cover duplicates, customer withdrawal and agent error. Those mechanisms might deserve separate competing causes or a sensitivity analysis, depending on the operational decision. Sparse events leave unstable cause-specific estimates at late times. Report each event count, censor count and risk count, plus the event-code version and observation cutoff. The audit project applies these checks to a release packet.

Implementation

python
def cumulative_outcome_incidence(event_rows):
    event_free = 1.0
    resolved_incidence = 0.0
    cancelled_incidence = 0.0
    output = []
    for day, at_risk, resolved, cancelled, censored in event_rows:
        if at_risk <= 0 or min(resolved, cancelled, censored) < 0:
            raise ValueError("invalid event count")
        if resolved + cancelled + censored > at_risk:
            raise ValueError("more outcomes than cases at risk")
        resolved_incidence += event_free * resolved / at_risk
        cancelled_incidence += event_free * cancelled / at_risk
        event_free *= 1 - (resolved + cancelled) / at_risk
        output.append((day, resolved_incidence, cancelled_incidence, event_free))
    return output

ledger = [(2, 6, 1, 0, 0), (3, 5, 0, 1, 1),
          (5, 3, 1, 0, 0), (7, 2, 1, 1, 0)]
incidence = cumulative_outcome_incidence(ledger)
assert round(incidence[-1][1], 6) == round(11 / 18, 6)
assert round(incidence[-1][2], 6) == round(7 / 18, 6)
assert round(sum(incidence[-1][1:]), 6) == 1.0

Performance and operating cost

For U sorted event times and K terminal causes, a full event table costs O(U × K) time and output space. The two-cause scan shown uses O(U) time and output space. Cause coding and enough mature follow-up are the real constraints.

Common Mistakes

  • Do not classify a terminal competing exit as ordinary administrative censoring.
  • Do not add a censored case to any event incidence.
  • Do not interpret cause-specific incidence as a causal effect of preventing another cause.

Read next

Continue the workflow: Competing-outcome contracts at a fixed horizon.

Continue the workflow: Competing events and service-policy review.

ai-data
data-science
Storage details