Why Implementation Details Matter
A cumulative-incidence estimate can be wrong even when its formula looks familiar. The most common coding and hand-calculation failures are small timing errors: removing a person from the risk set too soon, updating event-free probability before calculating an event-time increment, or processing tied causes as if one happened after another. A different error—censoring competing events—can produce a smooth, plausible estimate that answers a different question.
The key is to keep the order of calculation explicit. At each distinct event time, first identify who is at risk immediately before that time. Use that risk set to calculate all cause-specific event counts and the event-free probability just before the time. Then calculate the cumulative-incidence jumps, and only after that update the event-free probability.
These formulas use a risk set defined immediately before each event time. Individuals with an event at \(t_j\) are still in \(Y_j\); they leave after the increments at \(t_j\) are calculated. Individuals censored at \(t_j\) are likewise included in the pre-time risk set under the usual convention that they are observed through \(t_j\). The recorded event and censoring times must follow the study’s stated convention. If entry is delayed, a person contributes to the risk set only after entering follow-up.
A Reliable Event-Time Order
The order is not a cosmetic choice. The factor \(\hat S(t_j-)\) represents the estimated probability of reaching \(t_j\) without any event. It must therefore be the value before events at \(t_j\) reduce event-free probability. Similarly, \(Y_j\) counts people who could experience an event at \(t_j\), not the smaller number left after those events.
At each distinct event time, identify the people still under observation and event-free immediately beforehand.
Record \(d_{kj}\) for every cause and the total \(\sum_k d_{kj}\). Keep all events tied at this time together.
For every cause, use the same pre-event \(\hat S(t_j-)\) and \(Y_j\) in \(\hat S(t_j-)d_{kj}/Y_j\).
Reduce event-free probability by the fraction experiencing any event; remove event cases from subsequent risk sets.
The usual interpretation of the estimate relies on accurate event times and cause labels and on censoring being noninformative for future event experience, at least conditional on the variables or strata used in the analysis. These conditions do not repair an incorrectly constructed risk set. A calculation can follow the formula perfectly and still be invalid if events were misclassified, follow-up was not represented correctly, or censoring is informative.
Worked Calculations: Ordering and Denominators
Worked Example: Using Event-Free Probability Before the Event
In a hypothetical group of 6 people, at time 1 there is 1 event from cause 1 and 1 from cause 2. At time 2, there is 1 event from cause 1 and 1 censoring. Assume there are no other events or censorings before time 2. Estimate cause 1 cumulative incidence through time 2.
At time 1, \(Y_1=6\), and \(\hat S(1-)=1\). The cause 1 increment is $$ \Delta \hat F_1(1)=1\cdot\frac{1}{6}=\frac{1}{6}. $$ The total number of events at time 1 is 2, so the event-free estimate after time 1 is $$ \hat S(1)=1\left(1-\frac{2}{6}\right)=\frac{2}{3}. $$
Four people remain at risk immediately before time 2, so \(Y_2=4\). The censoring at time 2 does not remove a person before the time-2 event calculation. The cause 1 increment is $$ \Delta \hat F_1(2)=\frac{2}{3}\cdot\frac{1}{4}=\frac{1}{6}. $$ Thus $$ \hat F_1(2)=\frac{1}{6}+\frac{1}{6}=\frac{1}{3}\approx 0.3333. $$
A faulty calculation might use \(\hat S(1)=2/3\) for the time-1 increment, giving \((2/3)(1/6)=1/9\). That uses the probability after time-1 events to calculate the probability of an event at time 1. The required factor is \(\hat S(1-)=1\), before those events occur.
Worked Example: Keeping the Pre-Event Denominator
In a hypothetical group of 8 people, all 8 are at risk at time 1. Two experience cause 1 and one experiences cause 2 at that time. There were no earlier events. Calculate the cause 1 increment and compare it with an incorrect post-event denominator.
Immediately before time 1, \(\hat S(1-)=1\) and \(Y_1=8\). Therefore $$ \Delta \hat F_1(1)=1\cdot\frac{2}{8}=\frac{1}{4}=0.25. $$ The total event-free estimate after time 1 is $$ \hat S(1)=1\left(1-\frac{3}{8}\right)=\frac{5}{8}=0.625. $$
A faulty denominator uses the 5 people remaining after the three events: \(2/5=0.4\). That overstates the cause 1 jump because the two cause 1 events are among the people removed to form that post-event count. Event counts at a time must be divided by the risk set before those events, here 8, not by the number remaining afterward.
Ties and Competing Events
When causes have events at the same recorded time, calculate all cause-specific jumps from the same pre-event values. Do not update \(\hat S\) for one cause and then use the updated value to calculate another cause’s jump at that same time. The increments represent simultaneous contributions at a shared event time, not a sequence whose order is determined by the order of rows in a data file.
Worked Example: Calculating Tied Causes Together
Suppose, hypothetically, that 10 people are at risk at time 1, with 2 tied events from cause 1 and 1 tied event from cause 2. There are no earlier events, so \(\hat S(1-)=1\).
Using the common pre-event risk set, the correct increments are $$ \Delta \hat F_1(1)=1\cdot\frac{2}{10}=0.20, \qquad \Delta \hat F_2(1)=1\cdot\frac{1}{10}=0.10. $$ The total event-free probability after time 1 is \(1-3/10=0.70\).
One faulty procedure processes cause 1 first, reduces \(\hat S\) to \(0.80\), and then uses that updated value for the cause 2 jump while retaining the denominator 10. It obtains \(0.80(1/10)=0.08\) for cause 2 instead of \(0.10\). Reversing the processing order would instead give cause 1 an increment of \(0.90(2/10)=0.18\). The estimate must not depend on arbitrary cause order: both jumps use \(\hat S(1-)=1\) and \(Y_1=10\).
A different but related error is to censor a competing event when estimating the observed cumulative incidence. A competing event is a failure from another cause: it ends the possibility of subsequently experiencing the event of interest in the observed process. It contributes to the reduction in event-free probability, rather than being treated as ordinary loss to follow-up.
Worked Example: A Competing Event Is Not Censoring
In a hypothetical group of 10 people, 4 experience cause 2 at time 1. At time 2, 2 of the 6 remaining people experience cause 1. There are no other events or censorings. Calculate the cause 1 cumulative incidence through time 2.
At time 1, the cause 2 events reduce event-free probability to $$ \hat S(1)=1\left(1-\frac{4}{10}\right)=\frac{3}{5}=0.60. $$ At time 2, \(Y_2=6\), and the cause 1 increment is $$ \Delta \hat F_1(2)=\frac{3}{5}\cdot\frac{2}{6} =\frac{1}{5}=0.20. $$ There were no cause 1 events at time 1, so \(\hat F_1(2)=0.20\).
If the 4 cause 2 events are incorrectly treated as censoring and one instead computes a cause-specific Kaplan–Meier complement, the time-2 calculation is \(1-(1-2/6)=1/3\approx0.3333\). That is not the observed cause 1 cumulative incidence: it omits the reduction in the chance of reaching time 2 event-free caused by the earlier competing events. Ordinary right censoring and a competing failure have different roles in this calculation.
Checks That Help Locate Errors
A useful audit records, at every event time, the pre-event risk set, each cause count, the total event count, the pre-event event-free estimate, and the resulting increments. If a result looks surprising, inspect those intermediate quantities rather than only the final curve.
- Check event ordering. Confirm that each jump uses \(\hat S(t_j-)\), and that the update to \(\hat S(t_j)\) occurs only after all jumps at \(t_j\) are calculated.
- Check the risk-set denominator. Verify that \(Y_j\) is counted immediately before \(t_j\), includes the people with events at \(t_j\), and excludes people who had already failed or been censored earlier.
- Check tied counts. Confirm that all events with the same recorded time are counted together and every cause uses the same \(Y_j\) and \(\hat S(t_j-)\).
- Check competing-event coding. Confirm that a competing failure contributes to the total event count reducing \(\hat S\), rather than being entered as a censoring observation.
- Check basic bounds. Cause-specific increments should be nonnegative, and a cumulative-incidence estimate should not decrease. Across all causes, the accumulated event probabilities and event-free probability should be compatible with total probability, apart from rounding.
These checks are diagnostic, not a substitute for correct data handling. For example, a set of internally consistent calculations can still use the wrong event time because of a data-import error. Review event coding and the time convention as well as the arithmetic.
How the Common Alternatives Differ
The standard cumulative-incidence calculation combines the probability of being event-free just before a time with the fraction of the current risk set experiencing the cause of interest at that time. It differs from two tempting shortcuts:
| Calculation | What it does | Why it can mislead for observed cumulative incidence |
|---|---|---|
| Cause-specific Kaplan–Meier complement | Treats competing failures as censored when calculating the cause-specific event experience. | Does not account for the loss of event-free probability caused by competing failures. |
| Crude fraction with the cause of interest | Divides the number of observed cause-specific events by the original sample size. | Does not account appropriately for varying follow-up and censoring. |
| Cumulative-incidence estimator | Weights each cause-specific event fraction by the event-free probability just before its time. | Requires correct event times, cause labels, risk sets, and censoring assumptions. |
The alternatives are not interchangeable merely because their values are all between 0 and 1. A different calculation may target a different quantity or rely on different assumptions. For observed cumulative incidence, the implementation must retain competing failures as events and use the pre-event risk set and event-free probability.
Check Your Understanding
Answer each question, then compare your reasoning with the brief solutions below.
- At an event time, should the denominator include people who fail at that time? Why?
- There are 12 people at risk immediately before a tied time, and 2 cause 1 events occur. What denominator belongs in the cause 1 event fraction?
- At a tied time, why should cause 2 use \(\hat S(t-)\) rather than an event-free estimate updated for cause 1 at that same time?
- In one sentence, explain why treating a competing failure as censoring can overstate the observed cumulative incidence of the cause of interest.
Solutions. (1) Yes. They are in the risk set immediately before the event time, so the denominator is the pre-event risk-set size. (2) The denominator is 12, giving an event fraction of \(2/12=1/6\). (3) All tied causes are calculated using the same pre-event probability; updating between causes makes the answer depend on arbitrary processing order. (4) Censoring competing failures omits their reduction of the probability of remaining event-free, so later cause-specific events receive too much weight.