Survival aftsummary - 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
AftSummary
What an accelerated failure time fit reports, at lifelines parity, and the predictions it makes.
public sealed class AftSummary
Properties โ the per-coefficient lists are parallel and in lifelines' order: the primary parameter's covariates, then its intercept, then the ancillary parameter's block.
ParameterNamessays which parameter each coefficient belongs to:lambda_andrho_for the Weibull,mu_andsigma_for the log-normal,alpha_andbeta_for the log-logistic.CovariateIndicessays which design column it multiplies,-1for an intercept.Coefficientsare the estimates: the log of the parameter is the sum of each times its covariate.StandardErrorsare the square roots of the covariance's diagonal: the inverse observed information, or the sandwich whenRobust.ZStatisticsis each coefficient over its standard error, andPValuesare two-sided, from the normal tail.ConfidenceLowerandConfidenceUpperare each coefficient's interval atConfidenceLevel.ExpCoefficients,ExpConfidenceLowerandExpConfidenceUpperare the exponentials of the three above: how much a unit of the covariate multiplies the parameter.
For the model:
Modelis theAftModelfitted, andFeatureCountthe number of covariates a design row holds.LogLikelihoodis the log-likelihood at the fit, less the penalty on its summed scale: lifelines'log_likelihood_.NullLogLikelihoodis the univariate model's, with no covariate at all.LikelihoodRatioStatisticis twice their difference, andLikelihoodRatioPValueits chi-squared tail onLikelihoodRatioDegreesOfFreedomdegrees, the coefficients past the univariate model's two;NaNwhen there are none.Aicisโ2 ยท LogLikelihood + 2kover thekcoefficients.ConcordanceIndexis Harrell's C between the durations and the predicted medians;NaNfor an interval-censored fit.ConfidenceLevelis the level the intervals were built at, andRobustsays whether the standard errors, and everything built on them, are the Huber sandwich.
Example โ the fit of the AcceleratedFailureTime page: the dose,
the Weibull scale's intercept, and its shape.
using Lodestar.Survival;
double[] dose = [1.0, 2.0, 0.5, 3.0, 0.0, 1.5, 0.0, 2.5, 1.0, 0.5];
double[] months = [5, 8, 12, 3, 15, 9, 20, 6, 11, 14];
bool[] died = [true, true, false, true, true, true, false, true, true, false];
AftSummary fit = AcceleratedFailureTime.Fit(AftModel.Weibull, dose, months, died, featureCount: 1);
string intercept = fit.ParameterNames[1]; // => lambda_
int column = fit.CovariateIndices[1]; // => -1
string shape = fit.ParameterNames[2]; // => rho_
double statistic = Math.Round(fit.LikelihoodRatioStatistic, 6); // => 15.822317
double modelP = fit.LikelihoodRatioPValue; // => 6.9577โฆ
int degrees = fit.LikelihoodRatioDegreesOfFreedom; // => 1
Remarks โ every z statistic is measured from zero, a coefficient that does not move its
parameter. ParametricFit's are measured from lifelines' comparison values
instead, because its parameters are not on the log scale.
An exponentiated coefficient multiplies the parameter, not the hazard. For the Weibull, lambda_
is the time scale, so 0.577 per unit of dose means every percentile comes 0.577 times as soon; a Cox
hazard ratio would say how much more often the event happens. The two agree only through the shape:
for the Weibull, a hazard ratio is the time ratio to the power โฯ.
A class rather than a record, as CoxSummary is: it carries the fitted model its
predictions evaluate.
Applies to โ net10.0, netstandard2.0.
See also โ AcceleratedFailureTime.Fit, AftOptions.
Members
| Member | What it does |
|---|---|
AftSummary.PredictCumulativeHazard |
Each subject's cumulative hazard at given times. |
AftSummary.PredictExpectation |
Each subject's expected survival time. |
AftSummary.PredictMedian |
Each subject's median survival time. |
AftSummary.PredictPercentile |
The time each subject's survival falls to a level. |
AftSummary.PredictSurvivalFunction |
Each subject's survival at given times. |