I have done a ANOVA on 92 proteins to test difference between groups at the same time using
x <- data.frame(p.value=sapply(df[,2:93], function(i) summary(aov(i ~ df$X.Alcohol))[[1]][["Pr(>F)"]][[1]]))
pAlcohol<-x[x$p.value < 0.05/92,,drop=F]
To get the proteins that are significant different between the groups. I now want to do a post hoc test to se how the groups differ. This works:
y <- data.frame(post=sapply(df[,2:93], function(i) TukeyHSD((aov(i ~ df$X.Alcohol)), ordered = TRUE)))
But it does it for all the proteins and not just for the ones that are significant. I want it to do the test for just the proteins that are in pAlcohol.
Also right now when it does the post hoc test for all 92 proteins it list them on three rows(I have 3 groups). Is it possible to have 3 new rows for every protein?