Examples for 'broom::tidy.TukeyHSD'


Tidy a(n) TukeyHSD object

Aliases: tidy.TukeyHSD

Keywords:

### ** Examples


fm1 <- aov(breaks ~ wool + tension, data = warpbreaks)
thsd <- TukeyHSD(fm1, "tension", ordered = TRUE)
tidy(thsd)
# A tibble: 3 × 7
  term    contrast null.value estimate conf.low conf.high adj.p.value
  <chr>   <chr>         <dbl>    <dbl>    <dbl>     <dbl>       <dbl>
1 tension M-H               0     4.72   -4.63       14.1     0.447  
2 tension L-H               0    14.7     5.37       24.1     0.00112
3 tension L-M               0    10.0     0.647      19.4     0.0336 
# may include comparisons on multiple terms
fm2 <- aov(mpg ~ as.factor(gear) * as.factor(cyl), data = mtcars)
tidy(TukeyHSD(fm2))
# A tibble: 42 × 7
   term              contrast null.value estimate conf.low conf.high adj.p.value
   <chr>             <chr>         <dbl>    <dbl>    <dbl>     <dbl>       <dbl>
 1 as.factor(gear)   4-3               0    8.43     5.19      11.7   0.00000297
 2 as.factor(gear)   5-3               0    5.27     0.955      9.59  0.0147    
 3 as.factor(gear)   5-4               0   -3.15    -7.60       1.30  0.201     
 4 as.factor(cyl)    6-4               0   -5.40    -9.45      -1.36  0.00748   
 5 as.factor(cyl)    8-4               0   -5.23    -8.60      -1.86  0.00201   
 6 as.factor(cyl)    8-6               0    0.172   -3.70       4.04  0.993     
 7 as.factor(gear):… 4:4-3:4           0    5.42    -6.65      17.5   0.832     
 8 as.factor(gear):… 5:4-3:4           0    6.70    -7.24      20.6   0.778     
 9 as.factor(gear):… 3:6-3:4           0   -1.75   -15.7       12.2   1.00      
10 as.factor(gear):… 4:6-3:4           0   -1.75   -14.5       11.0   1.00      
# … with 32 more rows

[Package broom version 0.8.0 Index]