# Kruskal-Wallis Test

This is a non-parametric version of the F-Test (ANOVA). The test statistic is:

${\displaystyle H=(\sum _{j=1}^{g}\sum _{i=1}^{n_{j}}w_{ij}-1){\frac {\sum _{j=1}^{g}\sum _{i=1}^{n_{j}}w_{ij}({\bar {r}}_{\cdot j}-{\bar {r}})^{2}}{\sum _{j=1}^{g}\sum _{i=1}^{n_{j}}w_{ij}(r_{ij}-{\bar {r}})^{2}}}}$

where:

${\displaystyle n_{j}}$ is the number of observations in group ${\displaystyle j}$ of ${\displaystyle g}$groups,
${\displaystyle r_{ij}}$ is the rank of the ${\displaystyle i}$th observation from group ${\displaystyle j}$ where the ranking is computed across all the groups with a 1 assigned to the lowest value and the average rank is used for ties,
${\displaystyle n=\sum _{j=1}^{g}n_{j}}$,
${\displaystyle w_{ij}}$ is the Calibrated Weight,
${\displaystyle {\bar {r}}_{\cdot j}={\frac {\sum _{i=1}^{n_{j}}{w_{ij}r_{ij}}}{\sum _{i=1}^{n_{j}}w_{ij}}}}$,
${\displaystyle {\bar {r}}={\frac {\sum _{j=1}^{g}\sum _{i=1}^{n_{j}}w_{ij}r_{ij}}{\sum _{j=1}^{g}\sum _{i=1}^{n_{j}}w_{ij}}}}$,
${\displaystyle p\approx \Pr(\chi _{g-1}^{2}\geq H)}$