This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Running ANOVA in R on 4 different groups

Hello everyone

I'm starting to use R to analyze proteomic data. I have 4 different groups and I would like to compare differentially expressed proteins. I would like to apply a One-way ANOVA followed by a Tukey post hoc test.

My data is organized as follows:

Group.......... Protein 1.......... Protein 2 ......Protein3025
A
A
B
B
C
C
D
D

data <- read.delim("~/ANOVA Test/data.txt")
data$Group <- factor(data$Group, levels=c("A","B","C", "D"))

data$Group
> [1] A A B B  C C  D D 
> Levels: A B C D
 myformula <- " ~ Group"

for (i in 2:ncol(data))
{
formula <- paste(colnames(data)[i], myformula, sep="")
p <- summary(aov(as.formula(formula), data=data))[[1]][["Pr(>F)"]][1]
print(paste(formula, ": p=", p, sep=""))
}


>[1] "Q9C075 ~ Group: p=0.000525021327472293"
>[1] "Q6A162 ~ Group: p=0.000525021327472293"
>[1] "O76009 ~ Group: p=0.000525021327472293"
>[1] "P0DN37 ~ Group: p=0.000389600632838321"
>[1] "P0DN26 ~ Group: p=0.000389600632838321"
>[1] "F5H284 ~ Group: p=0.000389600632838321"

....

So far, I have this result, but I would like to know which proteins are regulated in all comparisons, that is, AB, AC, AD, BC, DC. Can someone help me? Is this approach correct?

Thanks in advance

r

1 answer

You will want to use Dunn's post-hoc test, which will test the pairwise comparisons between all possible groups as part of non-parametric ANOVA (Kruskal-Wallis test). The dunntest() function is part of the FSA package (CRAN). I trust that you will be able to look at the documentation and devise your own code from there.

Kevin

Thank you so much Kevin! You helped me a lot.

Sure thing my friend / Valeu

Log in to answer this question.