Survival 0.1.0 logrankresult - CyrilB1531/lodestar GitHub Wiki

Lodestar.Survival 0.1.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

LogRankResult

The outcome of a two-sample log-rank test.

public sealed record LogRankResult(double Statistic, double PValue, int DegreesOfFreedom)

ParametersStatistic is the log-rank statistic, PValue its upper-tail chi-squared probability, and DegreesOfFreedom is one for a two-sample comparison.

Example — two arms that cannot separate.

using Lodestar.Survival;

LogRankResult result = LogRank.Test(
    [2, 4, 6], [true, true, true],
    [2, 4, 6], [true, true, true]);

double statistic = result.Statistic;  // => 0
double p = result.PValue;  // => 1
int df = result.DegreesOfFreedom;  // => 1

RemarksStatistic is a square and is never negative. DegreesOfFreedom is a field rather than a constant because a k-sample log-rank would report k - 1, and a caller reading it should not have to know which test produced the record.

PValue comes from Distributions.ChiSquaredSf, the same tail the chi-squared tests in Lodestar.Stats report.

Applies to — net10.0, netstandard2.0.

See alsoLogRank.Test.