Hello. I have a question about the application of the dunn.test function. I'm new to R and sorry if this question is basic. I have cancer proteomics data, I have four groups: CTRL (n = 8), GBM1 (n = 6), GBM2 (n = 6), GBM3 (n = 6).
I need to know which proteins are regulated differently between groups. After reading it, I found out that I have to apply a non-parametric test and do a post hoc analysis to find out the comparisons in pairs.
Well, I started working with my data as follows:
GROUP P04899 P04406 Q93077
CTRL
CTRL
GBM1
GBM2
GBM3
I have over 2000 proteins
I started from the basics and saw that I have to apply this command:
A1 <- dunnTest (GBMTable$P04899 ~GBMTable$ Group, method = "bh")
Dunn (1964) Kruskal-Wallis multiple comparison
p-values adjusted with the Benjamini-Hochberg method.
Comparison Z P.unadj P.adj
1 CTRL - GBM1 -1.1322770 0.257517982 0.38627697
2 CTRL - GBM2 -2.1513264 0.031450449 0.09435135
3 GBM1 - GBM2 -1.0190493 0.308179547 0.36981546
4 CTRL -GBM3 0.7925939 0.428014450 0.42801445
5 GBM1 - GBM3 1.9248710 0.054245504 0.10849101
6 GBM2 - GBM3 2.9439203 0.003240835 0.01944501
But I wanted to do this for all proteins automatically, possibly using a "for" command, I believe. And I would like to save all the results in a file to open in excel.
Does anyone have a tip?
Thanks!
Thank you very much Kevin. It worked perfectly and in a few minutes I received my answer. I am relieved!