A case still open at the analysis cutoff has a known observed duration but an unknown final resolution time.
Right censoring and time-to-event analysis for open cases
Preserve the unknown
If a case was submitted 31 hours before the snapshot and remains open, its resolution time exceeds 31 hours. It is not a zero-hour resolution, and it is not necessarily a failure at 48 hours. Store the observed duration together with an event indicator. Cohort entry fixes when its clock began; the snapshot fixes where observation stopped.
Construct risk sets
At each observed resolution time, count cases still under observation immediately beforehand and the resolutions at that time. A product of one minus events divided by the risk-set count estimates the chance of remaining unresolved past successive event times. Censored cases contribute exposure until their censoring time, then leave the risk set. Ties require a declared ordering rule. The simple function below computes this product for nonnegative durations and binary event indicators.
Check the censoring assumption
This estimate needs censoring that is independent of future resolution, at least within any groups used for adjustment. A fixed administrative cutoff may be plausible, but cases abandoned because they are unusually difficult create a different problem. Report reasons for censoring and compare their distribution by channel and priority. If follow-up starts after submission for some cases, delayed entry needs explicit handling; the simple example does not support it.
Read the curve with care
Suppose seven cases have observed durations of 8, 13, 21, 34, 38, 53 and 61 hours; the 38- and 61-hour observations are censored. Do not average the five observed resolution times and call that the mean cohort resolution time. A survival curve can estimate the unresolved share at a stated horizon if that horizon is observed, but its far tail is fragile when few cases remain at risk. Show the at-risk count beside any reported horizon.
Tie estimates to service decisions
For a 48-hour service promise, report the estimated unresolved fraction at 48 hours and the number still at risk just before that point. Compare route or priority groups only after confirming their cohort-entry rules and follow-up periods match. Sensitivity analysis should show whether plausible informative censoring would change a staffing decision.
Implementation
from collections import Counter
from math import isclose
def unresolved_curve(observed_cases):
if any(duration < 0 or event not in (0, 1) for duration, event in observed_cases):
raise ValueError("invalid duration or event indicator")
risk = len(observed_cases)
survival = 1.0
points = []
event_counts = Counter(duration for duration, event in observed_cases if event)
censor_counts = Counter(duration for duration, event in observed_cases if not event)
for duration in sorted(event_counts.keys() | censor_counts.keys()):
events = event_counts[duration]
if events:
survival *= 1 - events / risk
points.append((duration, survival, risk))
risk -= events + censor_counts[duration]
return points
first_time, first_unresolved, first_risk = unresolved_curve([(8, 1), (13, 1), (21, 0)])[0]
assert first_time == 8 and first_risk == 3 and isclose(first_unresolved, 2 / 3)Performance and operating cost
Counting N records costs O(N) expected time and O(N) space; sorting distinct times costs O(U log U) for U unique durations. The implementation illustrates administrative right censoring and does not handle delayed entry, competing events, sampling weights or interval-censored times.
Common Mistakes
- Do not replace unknown final durations with the snapshot duration in an ordinary mean.
- Do not interpret a far-tail estimate without the at-risk count.
- Do not assume censoring is harmless when difficult cases leave observation early.
Read next
- Cohort entry and survivorship bias: count the cases that could fail
- Sensitivity analysis: find which assumptions can reverse a decision
- Bootstrap intervals: estimate uncertainty at the right sampling unit
- Project: audit support resolution with open cases and imperfect labels
Continue the workflow: Retention cohorts: return behavior only after a full observation window.
Continue the workflow: Event-time risk sets and tied outcomes.
Continue the workflow: Competing risks and resolution incidence.
Continue the workflow: Project: audit support resolution time and competing exits.
Continue the workflow: Interval-censored support resolution times.
Continue the workflow: Censoring survival weights and horizon support.
Continue the workflow: Time-to-event targets and censoring contracts.
Continue the workflow: Survival risk sets: keep censored cases until they leave observation.
