Tutorials › Competing Risks and Multi-State Models › A Hand Calculation With Censoring

Cumulative Incidence Functions · Tutorial 61 of 699

A Hand Calculation With Censoring

Learn to calculate the Aalen–Johansen cumulative incidence estimate by hand when some cohort members are right-censored.

Intermediate 10 min read

What You'll Learn

  • Build each event-time risk set after accounting for earlier events and censoring.
  • Update event-free survival using events from all causes.
  • Add the cause-specific event increment to cumulative incidence.
  • Handle tied event times and censoring at an event time consistently.
  • Check hand calculations using risk-set and probability-mass accounting.
  • Recognize why censoring is not counted as a competing event.

Why Censoring Changes the Hand Calculation

A hand calculation of cumulative incidence must account for two different ways a person can leave observation. An event removes a person from the event-free state and identifies the event cause. Right censoring ends observation before an event is seen; it removes a person from later risk sets but does not establish that an event occurred. If censoring is ignored, later event rates can be calculated with the wrong denominators. If censoring is treated as an event, the estimated probability of failure is distorted.

The calculation below follows the Aalen–Johansen estimator: at each distinct event time, use the people still at risk immediately before that time, update event-free survival using events from all causes, and add the appropriate cause-specific part of that event increment to cumulative incidence. The introductory material on cumulative incidence establishes its interpretation as the probability of experiencing a particular cause first by a given time; here the emphasis is on carrying out the arithmetic with right-censored observations.

Definition: For each individual, let \(T\) be the time to the first event or censoring, and let the status indicate either right censoring or an event cause. At distinct event time \(t_k\), let \(Y_k\) be the number at risk just before \(t_k\), \(d_k\) the total number of events at \(t_k\) from all causes, and \(d_{jk}\) the number of those events due to cause \(j\). The estimated event-free survival just after \(t_k\) is updated by multiplying the previous estimate by \(1-d_k/Y_k\). The estimated cumulative incidence for cause \(j\) increases by the previous event-free survival estimate multiplied by \(d_{jk}/Y_k\).

Write \(\widehat S(t_k-)\) for the estimated event-free survival immediately before event time \(t_k\), and \(\widehat S(t_k)\) for its value just after the events at that time. Write \(\widehat F_j(t_k)\) for the estimated cumulative incidence of cause \(j\) just after \(t_k\). Starting with \(\widehat S(0)=1\) and \(\widehat F_j(0)=0\), the updates are

$$ \widehat S(t_k)=\widehat S(t_k-)\left(1-\frac{d_k}{Y_k}\right), \qquad \widehat F_j(t_k)=\widehat F_j(t_k-)+\widehat S(t_k-)\frac{d_{jk}}{Y_k}. $$

Censored individuals are removed from subsequent risk sets at their censoring times, but censoring causes no immediate decrease in \(\widehat S\) and no increase in any \(\widehat F_j\). At an event time, the risk set is defined immediately before that time. Under the usual convention, individuals censored at that same recorded time are included in \(Y_k\) for the event calculation and are removed from risk sets afterward. If times are rounded or recorded in intervals, the handling of such ties should be specified and used consistently.

Assumptions and a Calculation Recipe

The hand calculation is a finite-sample computation of an estimator; it does not by itself guarantee that the estimator represents the target population. Its usual interpretation requires that event times and event causes are recorded correctly, and that censoring is independent of the event process under the study design or conditional on the variables used to define the analysis. In practical terms, people censored at a given time should not have systematically different unobserved future event experiences from otherwise comparable people still under observation. There must also be enough people under observation to estimate the event process over the times being considered.

These assumptions are not verified by the arithmetic. Review the follow-up protocol and censoring reasons, and check that event counts and risk sets agree with the individual records. The calculation assumes everyone starts under observation at time zero; with delayed entry, the risk set must also account for entry times, as in the earlier material on delayed entry.

1
Sort the event times.
List each distinct event time in order. Keep censoring times visible because they determine the risk set at later events.
2
Count people at risk and events.
For each event time, count \(Y_k\) immediately beforehand, then record \(d_k\) across all causes and \(d_{jk}\) for the cause being estimated.
3
Update survival and incidence.
Use the two update formulas. The survival value just before a time supplies the weight for that time’s cause-specific event increment.
4
Remove people from later risk sets.
After accounting for events at a time, remove those who had events and those censored at or before the next event time.

Worked Calculations

Worked Example: Sequential Events and Censoring

Consider a hypothetical cohort of eight people. The records are: one cause 1 event at time 1; one censoring at time 2; one cause 2 event at time 3; one censoring at time 4; one cause 1 event at time 5; one cause 2 event at time 6; one censoring at time 7; and one cause 1 event at time 8. Calculate the cause 1 cumulative incidence through the final event.

At time 1, all eight are at risk. The cause 1 increment is \(1/8\), so \(\widehat F_1=1/8=0.1250\), and event-free survival becomes \(1(1-1/8)=7/8=0.8750\). The time 2 censoring removes one person from later risk sets but does not change either estimate.

At time 3, six people are at risk: the time 1 event and the time 2 censoring have left six. The cause 2 event leaves five event-free people. Thus \(\widehat S(3)=(7/8)(1-1/6)=35/48=0.7292\); cause 1 cumulative incidence remains \(0.1250\), because the time 3 event was cause 2. The time 4 censoring reduces the five people remaining after time 3 to four at risk at time 5.

At time 5, \(Y=4\) and one cause 1 event occurs. Its increment is \((35/48)(1/4)=35/192=0.1823\). Therefore \(\widehat F_1(5)=1/8+35/192=59/192=0.3073\), and \(\widehat S(5)=(35/48)(3/4)=35/64=0.5469\).

At time 6, \(Y=3\), with one cause 2 event. Survival becomes \((35/64)(2/3)=35/96=0.3646\); cause 1 incidence does not change. The time 7 censoring leaves one person at risk at time 8. The cause 1 increment at time 8 is \((35/96)(1/1)=35/96\). Hence \(\widehat F_1(8)=59/192+70/192=129/192=0.6719\). The cause 1 estimate through time 8 is about 0.672, not the fraction of observed events that were cause 1: the calculation weights events by the estimated probability of remaining event-free up to each event time.

Worked Example: Two Causes at the Same Event Time

In a hypothetical cohort of six people, one has a cause 1 event at time 1, one is censored at time 2, one has a cause 1 event at time 3, one has a cause 2 event at time 3, one is censored at time 4, and one has a cause 2 event at time 5. Calculate both cause-specific cumulative incidence estimates through time 5.

At time 1, \(Y_1=6\), \(d_1=1\), and \(d_{1,1}=1\). Thus \(\widehat F_1=1/6\) and \(\widehat S=5/6\). Censoring at time 2 reduces the risk set for time 3 from five to four; it does not change \(\widehat S\).

At time 3, \(Y_2=4\), \(d_2=2\), and there is one event of each cause. The cause 1 increment is \((5/6)(1/4)=5/24\), so \(\widehat F_1=1/6+5/24=9/24=3/8=0.3750\). The cause 2 increment is also \(5/24\), and survival becomes \((5/6)(1-2/4)=5/12=0.4167\).

The time 4 censoring removes one of the two people who remained after the time 3 events, leaving \(Y=1\) at time 5. The cause 2 event then adds \((5/12)(1/1)=5/12\) to \(\widehat F_2\), giving \(\widehat F_2=5/24+10/24=15/24=5/8=0.6250\). There is no event-free survival after time 5. The two final cause-specific estimates sum to \(3/8+5/8=1\), consistent with the fact that all cohort members have had an event by then under this estimate.

Worked Example: Censoring at an Event Time

Suppose four hypothetical people have these records: a cause 1 event at time 2, censoring at time 2, a cause 2 event at time 3, and censoring at time 4. Apply the stated risk-set convention and calculate the estimates through time 3.

At time 2, all four people are at risk immediately before the event. The time 2 censoring is included in that risk set, so \(Y=4\), \(d=1\), and \(d_1=1\). Therefore \(\widehat F_1=1/4=0.2500\), \(\widehat S=3/4=0.7500\). The censoring at time 2 is then removed from later risk sets, leaving two people at risk at time 3.

At time 3, \(Y=2\), with one cause 2 event. The cause 2 increment is \((3/4)(1/2)=3/8=0.3750\). Thus \(\widehat F_2=0.3750\), while \(\widehat F_1\) remains \(0.2500\) and \(\widehat S=(3/4)(1/2)=0.3750\). The check \(0.2500+0.3750+0.3750=1\) confirms that the estimated event-free probability and the two cause-specific probabilities account for the full probability mass through time 3.

Why the Updates Work and How to Check Them

The cause-specific event increment follows from conditioning on still being event-free immediately before \(t_k\). Among the \(Y_k\) people at risk, the observed fraction with cause \(j\) at that time is \(d_{jk}/Y_k\). The estimated probability of having remained event-free up to just before \(t_k\) is \(\widehat S(t_k-)\). Multiplying these quantities gives the estimated probability of being event-free up to that time and then experiencing cause \(j\) at that time. Adding the increment to all earlier cause \(j\) increments gives cumulative incidence.

Likewise, among those at risk, the fraction without an event at \(t_k\) is \(1-d_k/Y_k\), because \(d_k\) includes events from every cause. Multiplying by the prior event-free survival gives the survival update. In particular, a competing event decreases event-free survival even though it does not add to the incidence of cause \(j\) being calculated.

$$ \widehat F_j(t_k)-\widehat F_j(t_k-) =\widehat S(t_k-)\frac{d_{jk}}{Y_k}, \qquad \widehat S(t_k-)-\widehat S(t_k) =\widehat S(t_k-)\frac{d_k}{Y_k}. $$

These equations also give a useful arithmetic check. Summing the incidence increments over all causes at a time gives \(\widehat S(t_k-)d_k/Y_k\), exactly the reduction in event-free survival. Consequently, if all causes are included, then after each event time

$$ \widehat S(t_k)+\sum_j \widehat F_j(t_k)=1. $$

This identity holds when the estimates start at survival one and incidence zero, and all event causes are included. It is a check on the arithmetic and event coding, not evidence that the censoring assumption is satisfied.

Common Mistakes, Alternatives, and Limits

  • Keeping censored people in later denominators. A person censored before an event time is no longer observed and must not be counted in that later risk set. This often makes denominators too large and increments too small.
  • Removing people too early. First calculate the risk set immediately before an event time. Then count events; remove those events and any censorings at that time for subsequent times. For example, a time 1 event and time 2 censoring leave six of eight people at risk at time 3, not eight.
  • Updating survival with only the cause of interest. Event-free survival uses \(d_k\), the total across causes. Using only \(d_{jk}\) incorrectly leaves competing events in the event-free state.
  • Treating censoring as a competing event. Censoring is not an observed failure cause. It removes someone from later risk sets but adds to neither a cause-specific incidence nor the event count \(d_k\).

The main alternative for a cohort with no censoring is a direct proportion of people experiencing each cause by the chosen time; with complete follow-up, that can agree with the cumulative incidence calculation. With censoring, the direct observed proportion generally does not account for incomplete follow-up. A cause-specific Kaplan–Meier calculation that treats other causes as censored answers a different hypothetical question; one minus that Kaplan–Meier estimate is not the observed-world cumulative incidence for that cause. The cumulative-incidence calculation instead combines the cause-specific event increments with survival from all causes.

A hand calculation is useful for understanding the estimator and auditing a small data set, but it is cumbersome for large cohorts and does not provide uncertainty intervals by itself. It can also be misleading if event causes are miscoded, risk sets are reconstructed incorrectly, censoring is informative, or estimates are interpreted beyond times with meaningful follow-up. For actual analyses, retain individual-level records and verify the risk-set counts computationally.

Check Your Understanding

Use the update formulas and the risk-set convention above. Solutions are included for checking each calculation.

  1. Five people are at risk at time 2. One experiences cause 1 and one experiences cause 2. If prior survival is 0.80 and prior cause 1 incidence is 0.10, calculate survival and cause 1 incidence just after time 2.
  2. Seven people start follow-up. One has an event at time 1, two are censored before time 3, and one has a cause 2 event at time 3. What is the risk set at time 3?
  3. At an event time, \(Y=10\), \(d=2\), and \(d_j=1\). Prior survival is 0.70 and prior incidence for cause \(j\) is 0.20. Calculate both updated estimates.
  4. Explain why a censoring at time 4 does not increase cause 1 cumulative incidence at time 4.

Solutions. (1) The cause 1 increment is \(0.80(1/5)=0.16\), so incidence is \(0.10+0.16=0.26\). Survival is \(0.80(1-2/5)=0.48\), using both causes in \(d\). (2) The time 1 event and two censorings before time 3 remove three people, so \(Y=7-3=4\). (3) Survival is \(0.70(1-2/10)=0.56\). Cause \(j\) incidence is \(0.20+0.70(1/10)=0.27\). (4) Censoring only indicates that subsequent event status is unobserved; it is not an event of cause 1, so it adds no event increment. It may reduce the risk set at later event times.

Clinical Biostats