My dataset is 5175 rows by 16 columns. Each row is a biological pathway, each column is a sample (n=4/group), and each observation is an enrichment score. Due to the small sample size and non-normal distribution, I am choosing nonparametric tests.
My goal is to first run a Kruskal-Wallis test between the four groups for each biological pathway and then apply the appropriate post-hoc tests.
My questions are as follows:
- What is the appropriate post-hoc test following KW? I have heard both Dunn and Mann-Whitney can work but am not sure
- Do I need to apply an FDR correction to the Kruskal-Wallis test due to the fact that I will be running >5000 tests?
- For the post-hoc pairwise comparisons, how do I simultaneously adjust for multiple comparisons (i.e. 4 groups) as well as for the fact that I am running >5000 tests?
Example R code:
#run KW test for each row
data$KW.pvalue <- apply(data,1, function(x) {
kruskal.test(values~ind,
data=stack(data.frame(cbind(
groupA=as.numeric(x[1:4]),
groupB=as.numeric(x[5:8]),
groupC=as.numeric(x[9:12]),
groupD=as.numeric(x[13:16]))
)))$p.value})