gpsea.analysis.temporal.stats package

gpsea.analysis.temporal.stats provides statistical tests for the survival analysis in GPSEA.

class gpsea.analysis.temporal.stats.SurvivalStatistic(name: str)[source]

Bases: Statistic

SurvivalStatistic calculates a p value for 2 or more survival groups computed by a SurvivalMetric.

abstract compute_pval(scores: Collection[Sequence[Survival]]) float[source]

Compute p value for the collection of survivals being sampled from the same source distribution.

class gpsea.analysis.temporal.stats.LogRankTest[source]

Bases: SurvivalStatistic

Log Rank test compares survivals of individual groups.

The class is a wrapper around Scipy’s logrank() function. A two-sided alternative hypothesis is tested.

compute_pval(scores: Collection[Iterable[Survival]]) float[source]

Compute p value for survivals being sourced from the same distribution.

Parameters:

scores – a pair of survival groups