0

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?

PrincessJellyfish
  • 149
  • 1
  • 1
  • 9
  • wouldn't you just replace occurrences of `df` with `pAlcohol` on your `y<-` line? BTW if you accept the answer to your previous question, you might get more help on this one :) – C8H10N4O2 Jul 06 '15 at 13:09
  • Oo, didn't know i could accept answers. =) Good to know. About changing `df` with `pAlcohol` dosn't work. Get the following messagge : `Error in sapply(pAlcohol[, 1:3], function(i) TukeyHSD((aov(i ~ df$X.Alcohol)), : error in evaluating the argument 'X' in selecting a method for function 'sapply': Error in `[.data.frame`(pAlcohol, , 1:3) : undefined columns selected` – PrincessJellyfish Jul 07 '15 at 14:38

0 Answers0