broom (version 0.4.1)

tidy.TukeyHSD: tidy a TukeyHSD object

Description

Returns a data.frame with one row for each pairwise comparison

Usage

"tidy"(x, separate.levels = FALSE, ...)

Arguments

x
object of class "TukeyHSD"
separate.levels
Whether to separate comparison into level1 and level2 columns
...
additional arguments (not used)

Value

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.

See Also

TukeyHSD

Examples

Run this code

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))

Run the code above in your browser using DataLab