Survival aalensummary predictcumulativehazard - 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 cumulative hazard at every event time: lifelines' predict_cumulative_hazard.
public double[] PredictCumulativeHazard(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 — row-major, one row per subject and one column per
EventTimes entry: each subject's covariates, with a one for the intercept,
times the cumulative coefficients.
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 and a treated patient, at the last of the ten event times.
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[] hazard = fit.PredictCumulativeHazard([0.0, 1.0]);
double untreated = Math.Round(hazard[9], 6); // => 2.45
double onTreatment = Math.Round(hazard[19], 6); // => 0.366667Remarks — the prediction is linear in the covariates, which is what "additive" means: the
treated patient's hazard is the untreated one's plus the treatment's cumulative coefficient,
2.45 − 2.083333. Nothing keeps it non-negative or non-decreasing; a design far from the fitted one can
give a cumulative hazard that falls.
Applies to — net10.0, netstandard2.0.
See also — AalenSummary,
AalenSummary.PredictSurvivalFunction.