tadaa_pairwise_t: Extended Pairwise t-Tests

Description Usage Arguments Value Note References See Also Examples

View source: R/tadaa_pairwise_t.R

Description

This is an extension of stats::pairwise.t.test that's meant to deal with interactions our of the box, while also performing pairwise tests for the primary terms. The output of the function is modeled after stats::TukeyHSD, unfortunately without confidence intervals or test statistic though.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
tadaa_pairwise_t(
  data,
  response,
  group1,
  group2 = NULL,
  p.adjust = "bonf",
  paired = FALSE,
  pool.sd = !paired,
  alternative = "two.sided",
  print = "df"
)

Arguments

data

A data.frame containing the variables.

response

The response variable, i.e. the dependent numeric vector.

group1

The grouping variables, typically a factor.

group2

(Optional) second grouping variable.

p.adjust

The p-adjustment method, see stats::p.adjust.methods, passed to stats::pairwise.t.test. Additionally, sidak is supported as a method, which is not the case with stats::p.adjust, as is sidakSD for the Sidak step-down procedure.

paired

Defaults to FALSE, also passed to stats::pairwise.t.test.

pool.sd

Defaults to the inverse of paired, passed to stats::pairwise.t.test.

alternative

Defaults to two.sided, also passed to stats::pairwise.t.test.

print

Print method, defaults to df for data.frame output, otherwise passed to pixiedust::sprinkle_print_method.

Value

A data.frame with columns term, comparison and adj.p.value.

Note

The adjustment method is applied within each term, meaning that the number of pairwise t-tests counted for the adjustment is only equal to the number of rows per term of the output. The additional Sidak adjustment method uses the following method: p_adj <- 1 - pbinom(q = 0, size = length(p_values), prob = p_values) And is sometimes preferred over Bonferroni. The Sidak-like (1987) step-down procedure (sidakSD) is an improvement over the Holm's (1979) step-down procedure.

References

https://stats.stackexchange.com/questions/20825/sidak-or-bonferroni

https://rdrr.io/rforge/mutoss/man/SidakSD.html

See Also

tadaa_pairwise_tukey()

Other Tadaa-functions: tadaa_aov(), tadaa_chisq(), tadaa_kruskal(), tadaa_levene(), tadaa_nom(), tadaa_one_sample(), tadaa_ord(), tadaa_pairwise_tukey(), tadaa_t.test(), tadaa_wilcoxon()

Examples

1
2
3
tadaa_pairwise_t(ngo, deutsch, jahrgang, geschl, p.adjust = "none", print = "console")
tadaa_pairwise_t(ngo, deutsch, jahrgang, geschl, p.adjust = "bonf", print = "console")
tadaa_pairwise_t(ngo, deutsch, jahrgang, geschl, p.adjust = "sidak", print = "console")

tadaatoolbox documentation built on July 2, 2020, 2:30 a.m.