Survival aalensummary predictmedian - 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
Each subject's median survival time: lifelines' predict_median.
public double[] PredictMedian(ReadOnlySpan<double> design)Parameters — design holds the subjects' covariates row-major, FeatureCount per row; empty
for the one subject of a fit with no covariate.
Returns — one time per subject, among EventTimes; infinity where the last
survival is still above one half.
Exceptions — ArgumentException when design is not whole rows of finite covariates.
ArgumentException naming design also when it, with any intercept column, or its rows times the
event times, is more cells than one array holds
(#1614,
#1616).
Example — an untreated patient, and a treated one whose survival never falls to one half.
using Lodestar.Survival;
double[] treated = [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1];
double[] months = [3, 10, 5, 4, 8, 18, 12, 6, 9, 20, 7, 15];
bool[] died = [true, true, true, false, true, true, true, true, true, false, true, true];
AalenSummary fit = AalenAdditive.Fit(treated, months, died, featureCount: 1);
double[] medians = fit.PredictMedian([0.0, 1.0]);
double untreated = medians[0]; // => 8
bool neverOnTreatment = double.IsPositiveInfinity(medians[1]); // => TrueRemarks — PredictPercentile at one half, with the same
reading of a curve that does not fall monotonically.
Applies to — net10.0, netstandard2.0.
See also — AalenSummary,
AalenSummary.PredictExpectation.