Kruskal-Wallis: 1-tailed or 2-tailed?

Hello!

I have a general question regarding the output data from Kruskal-Wallis pairwise comparison tests on microbiome data. Is this stats test, and the associated p-values generated, 1-tailed or 2-tailed? I have one reviewer who is curious.

Thanks, in advance!

Hello Hasti_A,

Could you tell us the command you used? I can look up how the test is run based on that.

Thanks!

Hi Colin,

Sure! I'm focusing on just Shannon group significance, but this is the overall command I used:

> for metric in observed_features shannon pielou_e faith_pd
do
  qiime diversity alpha-group-significance \
    --i-alpha-diversity ${metric}_vector.qza \
    --m-metadata-file ../metadata_for_comb_abdomens.tsv \
    --o-visualization ${metric}_group_significance.qzv
done

Thanks!

Here's the Qiime2 plugin code for making that visualizer:

And here are the docs for the kruskalwallis function:
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kruskal.html#scipy.stats.kruskal

The p-value for the test using the assumption that H has a chi square distribution. The p-value returned is the survival function of the chi square distribution evaluated at H.

As discussed in this GitHub issue, it's one-sided.


Bonus!

    kw_H_pairwise['q-value'] = multipletests(
        kw_H_pairwise['p-value'], method='fdr_bh')[1]

This means when you have multiple tests, the false discovery rate is controlled with the Benjamini & Hochberg (1995) method!

Hopefully this helps answer the ref's questions and gets the paper published!

2 Likes

Fantastic! This is SO helpful, thank you so much. Appreciate your help.

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.