I know there are a lot of post about how to extract the p-value from an aov
. However, I have a list with several thousand samples. i did an aov for each sample to compare two different treatments and now i am looking for a way to get a list with all the p-values, as i cannot copy them one by one..
is this even possible?
I had no problems doing this for the p-values created by a ttest
:
results <- apply(data,1,function(x){t.test(x[1:3],x[4:6])$p.value})
data is my imported .csv and [1:3] indicates the columns that are compared with the columns [4:6]
so that really was not a problem, but it seems not to be possible to do something similar for the aov:
results <- apply(data,1,function(x){aov(x[1:3]~x[4:6])})
i cannot get a list with all the p-values (that are called Pr(>F)..which is kind of frustrating.. hope you understand what i am trying to do,