Tidy summarizes information about the components of a model. A model component might be a single term in a regression, a single hypothesis, a cluster, or a class. Exactly what tidy considers to be a model component varies across models but is usually self-evident. If a model has several distinct types of components, you will need to specify which components to return.
# S3 method for TukeyHSD tidy(x, ...)
x | A |
---|---|
... | Additional arguments. Not used. Needed to match generic
signature only. Cautionary note: Misspelled arguments will be
absorbed in |
Other anova tidiers:
glance.aov()
,
tidy.anova()
,
tidy.aovlist()
,
tidy.aov()
,
tidy.manova()
A tibble::tibble()
with columns:
P-value adjusted for multiple comparisons.
Upper bound on the confidence interval for the estimate.
Lower bound on the confidence interval for the estimate.
Levels being compared.
The estimated value of the regression term.
Value to which the estimate is compared.
The name of the regression term.
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.43 -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