Nonparametric Tests for Multi-Sample Problems

multisample.hettmansperger_norton_test(data, group, alternative='increasing', trend=None)[source]

Function to calculate the Hettmansperger-Norton test.

Args:

data (list(float)): data from all groups

group (list(int)): group factor

alternative (str): either ‘increasing’, ‘decreasing’ or ‘custom’

trend (list(float)): a vector specifying the alternative; only used, if alternative = ‘custom’

Returns:

namedtuple(‘HettmanspergerNortonResult’, (‘alternative’, ‘weight’, ‘statistic’, ‘pvalue’)):

chosen alternative (str)

trend (list(float))

test statistic (float)

one sided p-value (float)

References:
Hettmansperger, T. P., & Norton, R. M. (1987). Tests for patterned alternatives in k-sample problems. Journal of the American Statistical Association, 82(397), 292-299.
multisample.kruskal_wallis_test(data, group, pseudoranks=True)[source]

Function to calculate the Kruskal-Wallis test. It is recommended to use pseudo-ranks as ranks may lead to paradoxical results.

Null hypothesis H_0: F_1 = … F_a

Args:

data (list(float)): data from all groups

group (list(int)): group factor

pseudoranks (bool): True if pseudo-ranks instead of ranks are used

Returns:

namedtuple(‘KruskalWallisResult’, (‘statistic’, ‘pvalue’)):

test statistic (float)

p-value (float)