Criteria

survivors.criteria.CRITERIA_DICT = {'logrank': <function logrank>, 'peto': <function peto>, 'tarone-ware': <function tarone_ware>, 'wilcoxon': <function wilcoxon>}

dict: Available criteria in library and its realization

survivors.criteria.chi2_sf(x, df)

Probability value (1-tail) for the Chi^2 probability distribution.

Broadcasting rules apply.

Parameters

x : array_like or float > 0 df : array_like or float, probably int >= 1

Returns

chisqprobndarray

The area from chisq to infinity under the Chi^2 probability distribution with degrees of freedom df.

survivors.criteria.find_inverse_gamma(a, p, q)

In order to understand what’s going on here, you will need to refer to:

Computation of the Incomplete Gamma Function Ratios and their Inverse ARMIDO R. DIDONATO and ALFRED H. MORRIS, JR. ACM Transactions on Mathematical Software, Vol. 12, No. 4, December 1986, Pages 377-393.

survivors.criteria.polyval(p, x)

Evaluate a polynomial by Horner’s scheme

survivors.criteria.weight_lr_fast(dur_A, dur_B, cens_A=None, cens_B=None, weightings='')

Count weighted log-rank criteria

Parameters

dur_Aarray-like

Time of occurred events from first sample.

dur_Barray-like

Time of occurred events from second sample.

cens_Aarray-like, optional

Indicate of occurred events from first sample. The default is None (all events occurred).

cens_Barray-like, optional

Indicate of occurred events from second sample. The default is None (all events occurred).

weightingsstr, optional

Weights of criteria. The default is “” (log-rank). Log-rank :math:’w = 1’ Wilcoxon :math:’w = N_j’ Tarone-ware :math:’w = sqrt(N_j)’ Peto-peto :math:’w = fraq{1 - O_j}{N_j + 1}’

Returns

logrankfloat

Chi2 statistic value of weighted log-rank test