1

What I need is a non-parametric alternative for Dunnett test to compare several groups with a control group (not all pairwise comparisons). And I realise that a specialised test is more appropriate than multiple Mann-Whitney test because it would use the same ranks as Kruskal-Wallis test.

This article about Dunn test says

"The Dunn is an alternative to the Tukey test when you only want to test for differences in a small subset of all possible pairs"

But I couldn't find any (R) implementation of Dunn test where it would be possible to select the comparisons I'd like to make. Existing options like dunn.test::dunn.test() perform complete set of pairwise comparisons. And I guess, removing unnecessary comparisons could enhance it's power.

Is there any test like that or what would be the best way to tackle this task?

Alexis
  • 26,219
  • 5
  • 78
  • 131
lapotok
  • 13
  • 2

1 Answers1

1

You could use dunn.test() to calculate the unadjusted p-values (you have to provide a method before it will perform adjustments for multiplicity, otherwise the p-values are unadjusted and so not penalised for groups not involved in that particular pairwise comparison), which you can then use however you wish, e.g. Bonferroni or Holm's, but only making the adjustments for the comparisons of interest. The approaches for the adjustment methods in dunn.test() are all sufficiently well described in its manual for you to do these by hand, but you could also use p.adjust() to do this for you.

Below is a simple example with three groups where group 0 is the control with two treatments to be compared with the control but not with each other. I'm not recommending Bonferroni as a method, but it makes it clear what's going on. If you pass all three p-values to p.adjust(), you get the same adjusted values as from dunn.test(method="bonferroni"), but you can, instead, pass it just the two p-values for the two comparisons that you were interested in.

> mydata.response <- seq(1,9)
> mydata.group <- c(rep(0,3), rep(1,3), rep(2,3))
> cbind(mydata.response, mydata.group)
      mydata.response mydata.group
 [1,]               1            0
 [2,]               2            0
 [3,]               3            0
 [4,]               4            1
 [5,]               5            1
 [6,]               6            1
 [7,]               7            2
 [8,]               8            2
 [9,]               9            2
> 
> library(dunn.test)
> myresults.unadjusted <- dunn.test(mydata.response, mydata.group)
  Kruskal-Wallis rank sum test

data: mydata.response and mydata.group
Kruskal-Wallis chi-squared = 7.2, df = 2, p-value = 0.03


                 Comparison of mydata.response by mydata.group                 
                                (No adjustment)                                
Col Mean-|
Row Mean |          0          1
---------+----------------------
       1 |  -1.341640
         |     0.0899
         |
       2 |  -2.683281  -1.341640
         |    0.0036*     0.0899

alpha = 0.05
Reject Ho if p <= alpha/2
> myresults.adjusted <-dunn.test(mydata.response, mydata.group, method="bonferroni")
  Kruskal-Wallis rank sum test

data: mydata.response and mydata.group
Kruskal-Wallis chi-squared = 7.2, df = 2, p-value = 0.03


                 Comparison of mydata.response by mydata.group                 
                                 (Bonferroni)                                  
Col Mean-|
Row Mean |          0          1
---------+----------------------
       1 |  -1.341640
         |     0.2696
         |
       2 |  -2.683281  -1.341640
         |    0.0109*     0.2696

alpha = 0.05
Reject Ho if p <= alpha/2
> myresults.unadjusted$P
[1] 0.089856247 0.003645179 0.089856247
> myresults.adjusted$P.adjusted
[1] 0.26956874 0.01093554 0.26956874
> 
> p.adjust(myresults.unadjusted$P[1:3], method="bonferroni")
[1] 0.26956874 0.01093554 0.26956874
> p.adjust(myresults.unadjusted$P[1:2], method="bonferroni")
[1] 0.179712495 0.007290358
user215517
  • 337
  • 1
  • 5