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 cross 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 pairwise.htest tidy(x, ...)
x | A |
---|---|
... | Additional arguments. Not used. Needed to match generic
signature only. Cautionary note: Misspelled arguments will be
absorbed in |
A tibble::tibble with one row per group/group comparison and columns:
First group being compared
Second group being compared
(Adjusted) p-value of comparison
Note that in one-sided tests, the alternative hypothesis of each test can be stated as "group1 is greater/less than group2".
Note also that the columns of group1 and group2 will always be a factor, even if the original input is (e.g.) numeric.
stats::pairwise.t.test()
, stats::pairwise.wilcox.test()
,
tidy()
Other htest tidiers: augment.htest
,
tidy.htest
, tidy.power.htest
attach(airquality) Month <- factor(Month, labels = month.abb[5:9]) ptt <- pairwise.t.test(Ozone, Month) tidy(ptt)#> # A tibble: 10 x 3 #> group1 group2 p.value #> <chr> <chr> <dbl> #> 1 Jun May 1 #> 2 Jul May 0.000264 #> 3 Aug May 0.000195 #> 4 Sep May 1 #> 5 Jul Jun 0.0511 #> 6 Aug Jun 0.0499 #> 7 Sep Jun 1 #> 8 Aug Jul 1 #> 9 Sep Jul 0.00488 #> 10 Sep Aug 0.00388#> # A tibble: 3 x 3 #> group1 group2 p.value #> <chr> <chr> <dbl> #> 1 versicolor setosa 1.05e-68 #> 2 virginica setosa 1.23e-90 #> 3 virginica versicolor 1.81e-31#> # A tibble: 3 x 3 #> group1 group2 p.value #> <chr> <chr> <dbl> #> 1 versicolor setosa 5.25e-69 #> 2 virginica setosa 6.16e-91 #> 3 virginica versicolor 9.05e-32#> # A tibble: 3 x 3 #> group1 group2 p.value #> <chr> <chr> <dbl> #> 1 versicolor setosa 1 #> 2 virginica setosa 1 #> 3 virginica versicolor 1#> # A tibble: 3 x 3 #> group1 group2 p.value #> <chr> <chr> <dbl> #> 1 versicolor setosa 1.70e-17 #> 2 virginica setosa 1.70e-17 #> 3 virginica versicolor 9.13e-17