0
$\begingroup$

I am running a kruskal wallis test a number of times (37) and wanted to know if I have to adjust the p-values of the kruskal tests before I look any further into the post hocs?

$\endgroup$
0
0
$\begingroup$

Not clear whether you're running one KW with 37 levels or 37 KWs (which begs several questions but here are r options for both...

# install.packages("dunn.test")
library(dunn.test)
# using built in airquality dataset
dunn.test::dunn.test(airquality$Ozone, 
                     airquality$Month,
                     method = "holm", 
                     alpha = 0.01)
#>   Kruskal-Wallis rank sum test
#> 
#> data: x and group
#> Kruskal-Wallis chi-squared = 29.2666, df = 4, p-value = 0
#> 
#> 
#>                            Comparison of x by group                            
#>                                     (Holm)                                     
#> Col Mean-|
#> Row Mean |          5          6          7          8
#> ---------+--------------------------------------------
#>        6 |  -0.925158
#>          |     0.5323
#>          |
#>        7 |  -4.419470  -2.244208
#>          |    0.0000*     0.0745
#>          |
#>        8 |  -4.132813  -2.038635   0.286657
#>          |    0.0002*     0.1037     0.7744
#>          |
#>        9 |  -1.321202   0.002538   3.217199   2.922827
#>          |     0.3729     0.4990     0.0052     0.0121
#> 
#> alpha = 0.01
#> Reject Ho if p <= alpha/2


set.seed(2020)
example_pvalues <-  runif(37, min = .0000000045, max = .5)
example_pvalues
#>  [1] 0.3234514211 0.1971128819 0.3092509089 0.2384455701 0.0680485967
#>  [6] 0.0336921973 0.0645763124 0.1965589675 0.0012913538 0.3101029788
#> [11] 0.3822070098 0.3719178801 0.4130828484 0.2113645443 0.2046438351
#> [16] 0.2698463088 0.4803611994 0.3267786687 0.2733576514 0.1330317863
#> [21] 0.0983978033 0.0389354644 0.4091966650 0.4712023208 0.4421122402
#> [26] 0.0829391937 0.1775506720 0.3740475097 0.2254752581 0.2779377208
#> [31] 0.4820365439 0.0357344742 0.4779045328 0.4739892955 0.0005938804
#> [36] 0.1836396416 0.0055202040
p.adjust(example_pvalues, method = "holm")
#>  [1] 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
#>  [7] 1.00000000 1.00000000 0.04648874 1.00000000 1.00000000 1.00000000
#> [13] 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
#> [19] 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
#> [25] 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000
#> [31] 1.00000000 1.00000000 1.00000000 1.00000000 0.02197357 1.00000000
#> [37] 0.19320714
$\endgroup$
2
  • $\begingroup$ Thank you. Yes its 37 KW tests each with its own multiple comparison - is there another perhaps better way of doing it as adjusting will only give me non significant results? $\endgroup$ Sep 14 '20 at 9:30
  • $\begingroup$ Sorry, I'm not sure I understand what you mean by "will only give me non significant results"? If you look at the help file for p.adjust it enumerates all the choices you have for method and an explanation for them. $\endgroup$
    – Chuck P
    Sep 14 '20 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.