1

I used a clustering tool to partition patient samples into two groups (group 1: n = 1035 patients; group 2: n = 1138 patients). Next, I want to see the statistical differences between them in terms of clinical features: Lymph nodes (continuous variables) and tumor stages (categorical variables)

Now, I used Kruskal Wallis test for the two clinical features above instead of Wilcoson sum rank test for Lymph node and Pearson's Chi-square for tumor stage. Is it accepted theoretically?

p/s: in the clustering processing, input is just a matrix whose rows are genes, columns are patients.

Huy Nguyen
  • 33
  • 1
  • 5

2 Answers2

1

This is not directly related to the specific test used, but it's worth being aware of the problem of "double dipping", and if necessary correcting for it. In this case you are double dipping by using the same data to define clusters, and to test the hypothesis.

Here is a reference: Selective Inference for Hierarchical Clustering

Testing for a difference in means between two groups is fundamental to answering research questions across virtually every scientific area. Classical tests control the Type I error rate when the groups are defined a priori. However, when the groups are instead defined via a clustering algorithm, then applying a classical test for a difference in means between the groups yields an extremely inflated Type I error rate.

Nayef
  • 651
0

Kruskal-Wallis for 2 groups instead of 2-Sample Wilcoxon: Seems OK. Using a Kruskal-Wallis test (which will accommodate $k\ge 2$ levels of a factor, for only two levels, is essentially the same as using a two-sample Mann-Whitney-Wilcoxon rank sum test.

In R, the syntax is a little different. And because the K-W test can handle more than two levels, a few rounding conventions, corrections for ties, and so on, may be implemented a little differently between the two R procedures kw.test and wilcox.test. So for many purposes, the two tests are equivalent. However, if you have only two groups, why not use wilcox.test to get the simpler version.

Here is an illustration:

set.seed(2020)
x1 = rnorm(500, 100, 15)
x2 = rnorm(500, 105, 15)
x = c(x1,x2);  g = rep(1:2, 500)
wilcox.test(x ~ g)

         Wilcoxon rank sum test 
       with continuity correction

data:  x by g
W = 128900, p-value = 0.3933
alternative hypothesis: 
  true location shift is not equal to 0

kruskal.test(x,g)

        Kruskal-Wallis rank sum test

data:  x and g
Kruskal-Wallis chi-squared = 0.72898, df = 1, 
   p-value = 0.3932

Also, it is easy to do one-sided tests with wilcox.test and not so easy with kruskal.test.

Using K-W for categorical data maybe not OK. However, because tumor stages is a categorical variable and the K-W test and Wilcoxon SR test are for ordinal data, I would have to know more about your data and objectives to say you can use K-W instead of a chi-squared analysis of counts in a table. Unless tumor stages are clearly ordinal, you could be making a mistake there.

BruceET
  • 56,185