← All examples

06 / 06 · Kaplan-Meier and log-rank

Teaching example. Synthetic data.

How long does a device remain failure-free?

Compare two device versions. Some tests ended before a failure occurred; those observations must not simply be discarded.

Open a copy and recalculate A separate copy of the example opens in a new tab. Changes there won’t affect your current project.

Theory: Time to event: Kaplan-Meier and log-rank →

12 devices · 8 failures

Steps show the estimated probability of remaining failure-free. Marks indicate censored observations.
Failures / observations
8 / 12
Logrank test: p
0.586
Inspect the original observations
GroupTimeEvent: 1 = yes, 0 = no
Version A01
Version A21
Version A40
Version A61
Version A81
Version A100
Version B11
Version B30
Version B51
Version B71
Version B90
Version B111

Calculated by the Linza engine from this example’s data. Opening it in the editor runs a fresh calculation.

Why this method

Kaplan-Meier uses time to failure and right censoring. A censored device is only known to have avoided failure up to its last observation. Comparing mean observed times would lose this distinction. The logrank test compares whole curves rather than a selected time point.

Explore the theory: Time to event: Kaplan-Meier and log-rank →

Work through it in Linza

In Data, distinguish time from failure status. Curve A has censoring at day 4: the number under observation decreases without a curve drop. Failure at day 6 creates a step. In Analyses, read the overall test alongside event counts and intervals.

Open a copy and recalculate

Try changing one condition

For version A at day 4, replace censoring with a failure. How does the curve change at that time?

Show the explanation

An additional downward step appears because day 4 now has a recorded failure. The event count increases. This changes the meaning of an observation; in research, event status must reflect what happened, not a desired result.

Data and reproducibility

Teaching studies with synthetic data. The scenarios reflect practical questions, but do not report real experimental findings.