The null hypothesis of the Kruskal–Wallis test is that the mean ranks of the groups are the same. The expected mean rank depends only on the total number of observations (for n observations, the expected mean rank in each group is (n+1)/2), so it is not a very useful description of the data; it’s not something you would plot on a graph.

You will sometimes see the null hypothesis of the Kruskal–Wallis test given as “The samples come from populations with the same distribution.” This is correct, in that if the samples come from populations with the same distribution, the Kruskal–Wallis test will show no difference among them. I think it’s a little misleading, however, because only some kinds of differences in distribution will be detected by the test. For example, if two populations have symmetrical distributions with the same center, but one is much wider than the other, their distributions are different but the Kruskal–Wallis test will not detect any difference between them.

The null hypothesis of the Kruskal–Wallis test is not that the means are the same. It is therefore incorrect to say something like “The mean concentration of fructose is higher in pears than in apples (Kruskal–Wallis test, P=0.02),” although you will see data summarized with means and then compared with Kruskal–Wallis tests in many publications. The common misunderstanding of the null hypothesis of Kruskal-Wallis is yet another reason I don’t like it.

The null hypothesis of the Kruskal–Wallis test is often said to be that the medians of the groups are equal, but this is only true if you assume that the shape of the distribution in each group is the same. If the distributions are different, the Kruskal–Wallis test can reject the null hypothesis even though the medians are the same.

Assumptions The assumptions of the Kruskal-Wallis test are similar to those for the Wilcoxon-Mann-Whitney test.

Samples are random samples, or allocation to treatment group is random. The two samples are mutually independent. The measurement scale is at least ordinal, and the variable is continuous. If the test is used as a test of dominance, it has no distributional assumptions. If it used to compare medians, the distributions must be similar apart from their locations. The test is generally considered to be robust to ties. However, if ties are present they should not be concentrated together in one part of the distribution (they should have either a normal or uniform distribution)

Kruskal wallis

OIDP

3M: p=0.33. 6M: p=0.82 12M: p= 0.89

Mean rank of OIDP3M is the same between groups at all points in time

## 
##  Kruskal-Wallis rank sum test
## 
## data:  OIDP_3M by TxAssign
## Kruskal-Wallis chi-squared = 2.2204, df = 2, p-value = 0.3295
## 
##  Kruskal-Wallis rank sum test
## 
## data:  OIDP_6M by TxAssign
## Kruskal-Wallis chi-squared = 0.3846, df = 2, p-value = 0.8251
## 
##  Kruskal-Wallis rank sum test
## 
## data:  OIDP_12M by TxAssign
## Kruskal-Wallis chi-squared = 0.21961, df = 2, p-value = 0.896

EQ5

3M: p=0.016 6M: p=0.02 12M: p=0.20

There is evidence of mean rank of EQ5-D5L being different between the treatment groups. At 3 and 6 months there is stronger evidence for this, while at 12 months there is weak evidence against the null hypothesis.

## 
##  Kruskal-Wallis rank sum test
## 
## data:  EQ5D5L_3M by TxAssign
## Kruskal-Wallis chi-squared = 8.3035, df = 2, p-value = 0.01574
## 
##  Kruskal-Wallis rank sum test
## 
## data:  EQ5D5L_6M by TxAssign
## Kruskal-Wallis chi-squared = 7.8136, df = 2, p-value = 0.0201
## 
##  Kruskal-Wallis rank sum test
## 
## data:  EQ5D5L_12M by TxAssign
## Kruskal-Wallis chi-squared = 3.2321, df = 2, p-value = 0.1987

EQ5 VAS

3M: p=0.07 6M: p=0.14 12M: p=0.3

There is little evidence of difference in mean rank of EQ5-VAS between groups. At 3 months there is some evidence for this, but at other points in time there is no evidence for such difference.

## 
##  Kruskal-Wallis rank sum test
## 
## data:  EQ5D_VAS_3M by TxAssign
## Kruskal-Wallis chi-squared = 5.3586, df = 2, p-value = 0.06861
## 
##  Kruskal-Wallis rank sum test
## 
## data:  EQ5D_VAS_6M by TxAssign
## Kruskal-Wallis chi-squared = 3.88, df = 2, p-value = 0.1437
## 
##  Kruskal-Wallis rank sum test
## 
## data:  EQ5D_VAS_12M by TxAssign
## Kruskal-Wallis chi-squared = 2.3972, df = 2, p-value = 0.3016

CSOIDP

3M: p=0.81 6M: p=0.84 12M: p=0.3

Mean rank of CSOIDP is the same between groups at all points in time

## 
##  Kruskal-Wallis rank sum test
## 
## data:  CSOIDP_3M by TxAssign
## Kruskal-Wallis chi-squared = 0.41663, df = 2, p-value = 0.812
## 
##  Kruskal-Wallis rank sum test
## 
## data:  CSOIDP_6M by TxAssign
## Kruskal-Wallis chi-squared = 0.33864, df = 2, p-value = 0.8442
## 
##  Kruskal-Wallis rank sum test
## 
## data:  CSOIDP_12M by TxAssign
## Kruskal-Wallis chi-squared = 2.3755, df = 2, p-value = 0.3049

Post PPD

3M: p=0.03 6M: p=0.4 12M: p=0.67

Similar to EQ5-VAS

There is little evidence of difference in mean rank of Post PPD between groups. At 3 months there is evidence for this, but at other points in time there is no evidence for such difference.

## 
##  Kruskal-Wallis rank sum test
## 
## data:  PostPPD_3M by TxAssign
## Kruskal-Wallis chi-squared = 6.7524, df = 2, p-value = 0.03418
## 
##  Kruskal-Wallis rank sum test
## 
## data:  PostPPD_6M by TxAssign
## Kruskal-Wallis chi-squared = 1.7979, df = 2, p-value = 0.407
## 
##  Kruskal-Wallis rank sum test
## 
## data:  PostPPD_12M by TxAssign
## Kruskal-Wallis chi-squared = 0.81343, df = 2, p-value = 0.6658

Post N PPD 5

3M: p=0.13 6M: p=0.5 12M: p=0.89

Mean rank of Post N PPD 5 is the same between groups at all points in time

## 
##  Kruskal-Wallis rank sum test
## 
## data:  PostNoPPD.5_3M by TxAssign
## Kruskal-Wallis chi-squared = 4.0472, df = 2, p-value = 0.1322
## 
##  Kruskal-Wallis rank sum test
## 
## data:  PostNoPPD.5_6M by TxAssign
## Kruskal-Wallis chi-squared = 1.3779, df = 2, p-value = 0.5021
## 
##  Kruskal-Wallis rank sum test
## 
## data:  PostNoPPD.5_12M by TxAssign
## Kruskal-Wallis chi-squared = 0.22105, df = 2, p-value = 0.8954

Post REC

3M: p=0.15 6M: p=0.5 12M: p=0.8

Mean rank of Post REC is the same between groups at all points in time

## 
##  Kruskal-Wallis rank sum test
## 
## data:  PostREC_3M by TxAssign
## Kruskal-Wallis chi-squared = 3.812, df = 2, p-value = 0.1487
## 
##  Kruskal-Wallis rank sum test
## 
## data:  PostREC_6M by TxAssign
## Kruskal-Wallis chi-squared = 1.3502, df = 2, p-value = 0.5091
## 
##  Kruskal-Wallis rank sum test
## 
## data:  PostREC_12M by TxAssign
## Kruskal-Wallis chi-squared = 0.43233, df = 2, p-value = 0.8056

FMBS

3M: p=0.46 6M: p=0.87 12M: p=0.16

Mean rank of FMBS is the same between groups at all points in time

kruskal.test(FMBS_3M ~ TxAssign, data = df1)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  FMBS_3M by TxAssign
## Kruskal-Wallis chi-squared = 1.5366, df = 2, p-value = 0.4638
kruskal.test(FMBS_6M ~ TxAssign, data = df1)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  FMBS_6M by TxAssign
## Kruskal-Wallis chi-squared = 0.28171, df = 2, p-value = 0.8686
kruskal.test(FMBS_12M ~ TxAssign, data = df1)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  FMBS_12M by TxAssign
## Kruskal-Wallis chi-squared = 3.5998, df = 2, p-value = 0.1653

FMPS

3M: p=0.512 6M: p=0.29 12M: p=0.35

Mean rank of FMPS is the same between groups at all points in time

## 
##  Kruskal-Wallis rank sum test
## 
## data:  FMPS_3M by TxAssign
## Kruskal-Wallis chi-squared = 1.3389, df = 2, p-value = 0.512
## 
##  Kruskal-Wallis rank sum test
## 
## data:  FMPS_6M by TxAssign
## Kruskal-Wallis chi-squared = 2.5087, df = 2, p-value = 0.2853
## 
##  Kruskal-Wallis rank sum test
## 
## data:  FMPS_12M by TxAssign
## Kruskal-Wallis chi-squared = 2.111, df = 2, p-value = 0.348