Survival coxsummary predictlogpartialhazard - 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

CoxSummary.PredictLogPartialHazard

Each subject's log partial hazard: lifelines' predict_log_partial_hazard.

public double[] PredictLogPartialHazard(ReadOnlySpan<double> design)

Parameters โ€” design holds the subjects' covariates row-major, one value per coefficient per subject.

Returns โ€” one value per subject, (x โˆ’ mean) ยท ฮฒ.

Exceptions โ€” ArgumentException when design is not a whole number of rows of finite values.

Example โ€” a subject at (2, 1) in the fit of the CoxSummary page.

using Lodestar.Survival;

double[] design = [1.0, 0.0, 2.0, 1.0, 1.5, 0.0, 3.0, 1.0, 2.5, 0.0,
                   0.5, 1.0, 2.0, 0.0, 1.0, 1.0, 3.5, 0.0, 0.5, 1.0];
double[] months = [12, 5, 20, 3, 15, 9, 8, 14, 2, 18];
bool[] died = [true, true, false, true, true, true, true, false, true, true];

CoxSummary fit = CoxProportionalHazards.Fit(design, months, died, featureCount: 2);
double value = Math.Round(fit.PredictLogPartialHazard([2.0, 1.0])[0], 6);   // => 1.079236

Remarks โ€” centred on the covariates' means in the fitted sample, CovariateMeans, as lifelines centres them; a subject at the means has zero.

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

See also โ€” CoxSummary, CoxBaseline.

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