Search

Search papers and lessons

Censored Data

Level 3 · 10 min read

Censored data are measurements where we know only a bound, such as survival past a certain time, and a correct likelihood uses that bound instead of discarding it.

On this page

  • Colour = topic mix
  • Probability
  • Calculus
  • Discrete math
  • Inference
  • Sign in to see your progress

TL;DR

Some measurements are incomplete. A patient may still be event-free when a study closes, or a component may still be working when its test ends. We do not know the exact time, only that it is at least some value. This is censoring. Two common shortcuts both bias the results: dropping those cases, or treating them as if the event happened at the cutoff. The correct approach writes a likelihood that uses each partial observation for exactly what it tells us.

Where you'll see it: in reliability tests that stop before every part fails, in churn models for customers who have not left yet, and as the input to the Kaplan–Meier estimator.

Intuition

Knowing only a bound

Imagine following ten light bulbs for 100 hours. Seven burn out during the study, and we record their exact failure times. The other three are still burning when the study ends. For those three we know the lifetime is more than 100 hours, but not by how much. Their lifetime has been cut off, or censored, at 100 hours.

This particular kind is called right censoring, because the unknown value lies to the right of what we recorded. The same idea appears in other forms. Left censoring means we know a value is below a detection limit. Interval censoring means we know only that a failure happened between two inspections. This lesson focuses on right censoring, the most common case.

Why the easy fixes fail

Two shortcuts come to mind first.

  1. Drop the censored bulbs. You keep only the seven that failed. Those are the short-lived ones, so the average lifetime looks shorter than it really is.
  2. Treat the censored times as failure times. The three surviving bulbs get recorded as failing at 100 hours. Their true failure times are later, so again the lifetimes look too short.

Both shortcuts bias the estimate in the same direction. The information "these three lasted at least 100 hours" is real evidence, and the goal is to use it.

flowchart LR
  S[Unit starts observation] --> Q{Does the event happen before observation stops?}
  Q -->|yes| E[Event observed at time t]
  Q -->|no| C[Censored at time c: lifetime is at least c]

The math

Observed time and status

Each unit ii has a true lifetime TiT_i and a censoring time CiC_i, the moment we stop watching it or it leaves the study. We never see TiT_i directly when it lies beyond CiC_i. What we record is

Yi=min⁡(Ti,Ci),δi=1{Ti≤Ci}.Y_i = \min(T_i, C_i), \qquad \delta_i = \mathbb{1}\{T_i \le C_i\}.

YiY_i is the observed time. The status δi\delta_i is 1 if the event was seen and 0 if the unit was censored. Here 1{⋅}\mathbb{1}\{\cdot\} is the indicator function, equal to 1 when the statement inside holds and 0 otherwise. The pairs (Yi,δi)(Y_i, \delta_i) are the whole dataset.

Definition: Right-censored observation

A unit is right-censored when we know only that its lifetime exceeds its censoring time, Ti>CiT_i \gt C_i. The data for that unit are yi=ciy_i = c_i and δi=0\delta_i = 0. A unit whose event was observed has yi=tiy_i = t_i and δi=1\delta_i = 1.

Building the likelihood

Maximum likelihood chooses the parameter θ\theta that makes the observed data most probable. So for each unit we need the probability of what we actually saw.

  • If the event was observed at time yy, the contribution is the density f(y;θ)f(y; \theta) of the lifetime at yy.
  • If the unit was censored at time cc, we know only that T>cT \gt c. The probability of that is the survival function, S(c;θ)=P(T>c)S(c; \theta) = P(T \gt c).

Assuming units are independent, the likelihood is the product of these contributions:

L(θ)=∏i: δi=1f(yi;θ)  ∏i: δi=0S(yi;θ).L(\theta) = \prod_{i:\,\delta_i = 1} f(y_i; \theta) \; \prod_{i:\,\delta_i = 0} S(y_i; \theta).

Taking logarithms turns the products into sums, which is easier to differentiate:

ℓ(θ)=∑i=1n[ δilog⁡f(yi;θ)+(1−δi)log⁡S(yi;θ) ].\ell(\theta) = \sum_{i=1}^{n} \Big[\, \delta_i \log f(y_i; \theta) + (1 - \delta_i) \log S(y_i; \theta) \,\Big].

This single formula is the thing to remember. Each unit contributes through its density if it failed, and through its survival probability if it did not.

Why a censored unit uses SS, not ff

A censored unit's exact failure time is unknown, so its density at the cutoff is the wrong quantity. Using f(c)f(c) would claim the failure happened exactly at cc, which we know is false. The correct statement is about a tail: the failure happened somewhere after cc. The probability of a tail is S(c)S(c). This is the one place where the likelihood uses the survival function rather than the density.

The exponential case

Suppose lifetimes are exponential with rate λ>0\lambda \gt 0, so f(t)=λe−λtf(t) = \lambda e^{-\lambda t} and S(t)=e−λtS(t) = e^{-\lambda t}. Let d=∑iδid = \sum_i \delta_i be the number of observed events, and let ∑iyi\sum_i y_i be the total observed time across all units. For an event, δi=1\delta_i = 1 and the contribution is log⁡λ−λyi\log \lambda - \lambda y_i. For a censored unit, δi=0\delta_i = 0 and the contribution is −λyi-\lambda y_i. Adding these together gives

ℓ(λ)=∑i[δi(log⁡λ−λyi)+(1−δi)(−λyi)]=dlog⁡λ−λ∑iyi.\begin{aligned} \ell(\lambda) &= \sum_{i} \Big[\delta_i \big(\log \lambda - \lambda y_i\big) + (1 - \delta_i)\big(-\lambda y_i\big)\Big] \\ &= d \log \lambda - \lambda \sum_{i} y_i. \end{aligned}

Setting the derivative to zero:

dℓdλ=dλ−∑iyi=0⟹λ^=d∑iyi.\frac{d\ell}{d\lambda} = \frac{d}{\lambda} - \sum_i y_i = 0 \quad\Longrightarrow\quad \hat{\lambda} = \frac{d}{\sum_i y_i}.

The estimate is the number of events divided by the total exposure time. Censored units add their time to the denominator but not to the numerator. That single asymmetry is the whole trick.

024681000.20.40.60.81t (hours)value
  • density f(t)
  • survival S(t)
For a rate of 0.2 per hour: the failed unit at t = 2 contributes the density 0.1341, and the unit censored at t = 4 contributes the survival 0.4493.

Worked examples

Example
A small study with censoring

Five units are watched. Here are their observed times and statuses.

unityy (hours)δ\deltawhat happened
A21failed at 2
B31failed at 3
C40still running at 4 (censored)
D61failed at 6
E70still running at 7 (censored)
  1. Count the events: d=3d = 3 (units A, B and D).
  2. Total observed time: 2+3+4+6+7=222 + 3 + 4 + 6 + 7 = 22 hours.
  3. Apply the formula: λ^=3/22≈0.136\hat{\lambda} = 3 / 22 \approx 0.136 per hour.
  4. Interpret: under the exponential model, the mean lifetime is 1/λ^≈7.31 / \hat{\lambda} \approx 7.3 hours.

Now compare the two shortcuts on the same data.

  1. Drop the censored units C and E. Only A, B and D remain, with total time 2+3+6=112 + 3 + 6 = 11. The estimate is 3/11≈0.2733 / 11 \approx 0.273, about twice the correct value.
  2. Treat the censored times as failures. All five count as events, so 5/22≈0.2275 / 22 \approx 0.227. Still too high.

Both shortcuts claim that failures come faster than the data support. Units C and E say only that they lasted at least 4 and 7 hours, and the likelihood uses exactly that.

Example
The likelihood of one failure and one censored unit

Take λ=0.2\lambda = 0.2 per hour. Unit X fails at t=2t = 2. Unit Y is censored at c=4c = 4.

  1. Unit X contributes its density: f(2)=0.2 e−0.4≈0.2×0.6703=0.1341f(2) = 0.2\, e^{-0.4} \approx 0.2 \times 0.6703 = 0.1341.
  2. Unit Y contributes its survival probability: S(4)=e−0.8≈0.4493S(4) = e^{-0.8} \approx 0.4493.
  3. The joint likelihood is L(0.2)=0.1341×0.4493≈0.0602L(0.2) = 0.1341 \times 0.4493 \approx 0.0602.
  4. The log-likelihood is ℓ(0.2)=log⁡0.1341+log⁡0.4493≈−2.0094−0.8000=−2.8094\ell(0.2) = \log 0.1341 + \log 0.4493 \approx -2.0094 - 0.8000 = -2.8094.

Interpretation: a value of λ\lambda that is too large makes the observed failure at 2 likely but makes the survival of unit Y past 4 unlikely, and the product balances the two. Maximising ℓ\ell over λ\lambda finds the value that balances them best.

Tradeoffs and failure modes

The likelihood above assumes non-informative censoring: the reason a unit leaves observation tells you nothing about how long it would have lasted. A bulb removed from a test for an unrelated reason satisfies this. A patient who drops out of a trial because they feel worse does not, and the estimates will be biased in a way more data will not fix.

SituationWhat goes wrongBetter choice
Censored units are droppedLifetimes look shorter than they areUse the likelihood with censoring terms
Censored times are treated as failuresLifetimes look shorter, in the same waySame fix
Censoring depends on the outcome, such as dropouts who are getting worseBias that does not shrink with more dataRecord the reason for censoring, and model it
Exponential assumed when the failure rate changes over timeThe likelihood is maximised but the shape is wrongCheck the fit, or use a nonparametric estimator
Heavy censoring with very few eventsEstimates are unstable and intervals are wideReport the uncertainty and avoid extrapolating past the last observed time

History

Actuaries and demographers worked with incomplete lives long before modern statistics. Edmond Halley's life table of 1693 is a well-known early example of turning mortality records into survival estimates. The modern treatment of incomplete data came in the late 1950s. Edward Kaplan and Paul Meier published a nonparametric way to estimate a survival curve when some observations are censored, in a 1958 paper in the Journal of the American Statistical Association. Their product-limit method became the standard in clinical and reliability studies. In 1972 David Cox introduced the proportional hazards model, which lets censored data be combined with covariates such as age or dose in a single regression-style likelihood.

Check yourself

QuestionRecall: in the likelihood, what does a status of δi=0\delta_i = 0 tell you about unit ii?Show answer

It means the unit was censored. Its event had not been seen by time yiy_i, so all we know is that its lifetime is greater than yiy_i. Its contribution to the likelihood is the survival probability S(yi)S(y_i), not the density.

QuestionComputation: four units are watched. Their observed times are 1 (failed), 5 (censored), 2 (failed) and 8 (failed). Under the exponential model, what is the MLE of the rate λ\lambda?Show answer

There are d=3d = 3 events. The total observed time is 1+5+2+8=161 + 5 + 2 + 8 = 16. So λ^=3/16=0.1875\hat{\lambda} = 3 / 16 = 0.1875 per time unit. The censored unit contributes its 5 units of time to the denominator and nothing to the numerator.

QuestionWhy: why is it wrong to write the likelihood of a censored unit as its density evaluated at the censoring time?Show answer

The density f(c)f(c) is the probability density that the failure happens at exactly cc. For a censored unit we know that the failure is not observed by cc, so the event lies somewhere after cc. The probability of a tail beyond cc is S(c)S(c). Using f(c)f(c) would assume a failure at exactly cc, which is a claim the data do not support.

QuestionApplied: a churn analysis exports customer records on a fixed date. Some customers have not cancelled by then. What enters the likelihood for those customers, and what happens if you delete them from the data?Show answer

Each customer who has not cancelled by the export date is right-censored at their tenure so far. They enter the likelihood through their survival probability S(tenure)S(\text{tenure}). Deleting them keeps only customers who have already left, so the estimated time until churn comes out too short. The fix is to keep them with their censored tenure, and to check whether the reason for censoring (the export date) is unrelated to whether they churn.

Sources