I would recommend to convert your data frame to long format and use pairwise.t.test
with appropriate p.adjust
:
> library(reshape2)
>
> df <- data.frame(a=runif(100),
+ b=runif(100),
+ c=runif(100)+0.5,
+ d=runif(100)+0.5,
+ e=runif(100)+1,
+ f=runif(100)+1)
>
> d <- melt(df)
Using as id variables
>
> pairwise.t.test(d$value, d$variable, p.adjust = "none")
Pairwise comparisons using t tests with pooled SD
data: d$value and d$variable
a b c d e
b 0.86 - - - -
c <2e-16 <2e-16 - - -
d <2e-16 <2e-16 0.73 - -
e <2e-16 <2e-16 <2e-16 <2e-16 -
f <2e-16 <2e-16 <2e-16 <2e-16 0.63
P value adjustment method: none
> pairwise.t.test(d$value, d$variable, p.adjust = "bon")
Pairwise comparisons using t tests with pooled SD
data: d$value and d$variable
a b c d e
b 1 - - - -
c <2e-16 <2e-16 - - -
d <2e-16 <2e-16 1 - -
e <2e-16 <2e-16 <2e-16 <2e-16 -
f <2e-16 <2e-16 <2e-16 <2e-16 1
P value adjustment method: bonferroni
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…