tidy.TukeyHSD {broom} | R Documentation |
Returns a data.frame with one row for each pairwise comparison
## S3 method for class 'TukeyHSD' tidy(x, separate.levels = FALSE, ...)
x |
object of class "TukeyHSD" |
separate.levels |
Whether to separate comparison into
|
... |
additional arguments (not used) |
A data.frame with one row per comparison, containing columns
term |
Term for which levels are being compared |
comparison |
Levels being compared, separated by - |
estimate |
Estimate of difference |
conf.low |
Low end of confidence interval of difference |
conf.high |
High end of confidence interval of difference |
adj.p.value |
P-value adjusted for multiple comparisons |
If separate.levels = TRUE
, the comparison
column will be
split up into level1
and level2
.
fm1 <- aov(breaks ~ wool + tension, data = warpbreaks) thsd <- TukeyHSD(fm1, "tension", ordered = TRUE) tidy(thsd) tidy(thsd, separate.levels = TRUE) # may include comparisons on multiple terms fm2 <- aov(mpg ~ as.factor(gear) * as.factor(cyl), data = mtcars) tidy(TukeyHSD(fm2))