tidy.pairwise.htest: Tidy a(n) pairwise.htest object

View source: R/stats-htest-tidiers.R

tidy.pairwise.htestR Documentation

Tidy a(n) pairwise.htest object

Description

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.

Usage

## S3 method for class 'pairwise.htest'
tidy(x, ...)

Arguments

x

A pairwise.htest object such as those returned from stats::pairwise.t.test() or stats::pairwise.wilcox.test().

...

Additional arguments. Not used. Needed to match generic signature only. Cautionary note: Misspelled arguments will be absorbed in ..., where they will be ignored. If the misspelled argument has a default value, the default value will be used. For example, if you pass conf.lvel = 0.9, all computation will proceed using conf.level = 0.95. Two exceptions here are:

  • tidy() methods will warn when supplied an exponentiate argument if it will be ignored.

  • augment() methods will warn when supplied a newdata argument if it will be ignored.

Details

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.

Value

A tibble::tibble() with columns:

group1

First group being compared.

group2

Second group being compared.

p.value

The two-sided p-value associated with the observed statistic.

See Also

stats::pairwise.t.test(), stats::pairwise.wilcox.test(), tidy()

Other htest tidiers: augment.htest(), tidy.htest(), tidy.power.htest()

Examples



attach(airquality)
Month <- factor(Month, labels = month.abb[5:9])
ptt <- pairwise.t.test(Ozone, Month)
tidy(ptt)

library(modeldata)
data(hpc_data)
attach(hpc_data)
ptt2 <- pairwise.t.test(compounds, class)
tidy(ptt2)

tidy(pairwise.t.test(compounds, class, alternative = "greater"))
tidy(pairwise.t.test(compounds, class, alternative = "less"))

tidy(pairwise.wilcox.test(compounds, class))


broom documentation built on Aug. 30, 2022, 1:07 a.m.