Survival breslowflemingharrington estimate - CyrilB1531/lodestar GitHub Wiki

Development build. This page describes main, not a released package. The latest published Lodestar.Survival is 0.2.0 โ€” read its documentation.

Home โ€บ Survival โ€บ Survival estimators

BreslowFlemingHarrington.Estimate

The survival function of a right-censored sample, whose subjects may enter late.

public static SurvivalCurve Estimate(ReadOnlySpan<double> durations, ReadOnlySpan<bool> eventObserved, double confidenceLevel = 0.95)
public static SurvivalCurve Estimate(ReadOnlySpan<double> durations, ReadOnlySpan<bool> eventObserved, ReadOnlySpan<double> entries, double confidenceLevel = 0.95)

The second overload takes lifelines' entry.

Parameters โ€” durations holds one non-negative time per subject, and eventObserved is true where it ends in the event, false where the subject was censored at it. entries holds each subject's entry time, non-negative and at most its duration, or is empty for everyone entering at zero. confidenceLevel lies strictly inside (0, 1).

Returns โ€” a SurvivalCurve at time zero, every duration and every entry time, with its bounds.

Exceptions โ€” ArgumentException when the spans differ in length, the sample is empty, a duration is negative or NaN, or the entries are neither empty nor one valid time per subject. ArgumentOutOfRangeException when confidenceLevel is not strictly inside (0, 1).

Example โ€” the first event, one in ten: exp(โˆ’1/10), and its interval.

using Lodestar.Survival;

double[] months = [5, 8, 12, 3, 15, 9, 20, 6, 11, 14];
bool[] died = [true, true, false, true, true, true, false, true, true, false];

SurvivalCurve curve = BreslowFlemingHarrington.Estimate(months, died);

double atThree = Math.Round(curve.Survival[1], 6);   // => 0.904837
double lower = Math.Round(curve.Lower[1], 6);        // => 0.49169
double upper = Math.Round(curve.Upper[1], 6);        // => 0.986012

Remarks โ€” a step with d events among n adds 1/n + โ€ฆ + 1/(n โˆ’ d + 1) to the hazard, and the squares of those to its variance, as lifelines' Nelson-Aalen fitter does with ties. The bounds are exp(โˆ’H e^{ยฑzโˆšV/H}), the log transform of the hazard's interval carried through exp(โˆ’ยท).

Lower is the smaller bound. lifelines labels the larger one its lower bound, being the image of the hazard's lower bound; the two columns hold the same numbers, swapped.

Late entrants join the risk set after the events at their entry time, as lifelines counts them, except at the first step; SurvivalStep.AtRisk reports them with the entrants, lifelines' at_risk. Each entry time is a step of its own even where nothing happens at it.

Applies to โ€” net10.0, netstandard2.0.

See also โ€” BreslowFlemingHarrington, NelsonAalen.Estimate, KaplanMeier.Estimate.

โš ๏ธ **GitHub.com Fallback** โš ๏ธ