[R] Physically extracting P-value from TukeyHSD test output

Pascal Oettli kridox at ymail.com
Thu Dec 13 08:56:36 CET 2012


Hello,

 > require(graphics)

 > summary(fm1 <- aov(breaks ~ wool + tension, data = warpbreaks))
 > THSD <- TukeyHSD(fm1, "tension", ordered = TRUE)
 > p.adj <- THSD$tension[,4]

HTH
Pascal


Le 13/12/2012 16:08, raz a écrit :
> Hey,
> I have this TukeyHSD output from which I would like to extract only the
> P-values (p adj, last number).
> The problem is that the test output is a character list.
> How can I "break" this sentence to separate the Pv?
>
>     Tukey multiple comparisons of means
>      95% family-wise confidence level
>
> Fit: aov(formula = Fe1$Fe ~ Fe1$genotype)
>
> $`Fe1$genotype`
>            diff        lwr       upr     p adj
> A1/D1-A1 -1.48 -12.660238  9.700238 0.9808395
> D1-A1     2.72  -8.460238 13.900238 0.8970997
> WT-A1    16.23   5.049762 27.410238 0.0037499
> D1-A1/D1  4.20  -6.980238 15.380238 0.7092182
> WT-A1/D1 17.71   6.529762 28.890238 0.0017396
> WT-D1    13.51   2.329762 24.690238 0.0154169
>
> Thanks
>




More information about the R-help mailing list