posthoc_anova: *!!* Post-hoc tests for ANOVA and Welch ANOVA

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/posthoc_anova.R

Description

Games-Howell, Tukey HSD and other post-hoc tests for ANOVA and Welch ANOVA. Either Games-Howell test or Tukey honestly significant difference (HSD) post-hoc tests for one-way analysis of variance (ANOVA).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
posthoc_anova(
  y,
  group = NULL,
  method = c("Games-Howell", "Tukey"),
  conf_level = 0.95,
  digits = 3,
  digits_p = 3,
  p_adjust = "none",
  format_pvalue = TRUE,
  data = NULL,
  ...
)

## S3 method for class 'formula'
posthoc_anova(
  y,
  group = NULL,
  method = c("Games-Howell", "Tukey"),
  conf_level = 0.95,
  digits = 3,
  digits_p = 3,
  p_adjust = "none",
  format_pvalue = TRUE,
  data = NULL,
  ...,
  sep = " | "
)

## Default S3 method:
posthoc_anova(
  y,
  group = NULL,
  method = c("Games-Howell", "Tukey"),
  conf_level = 0.95,
  digits = 3,
  digits_p = 3,
  p_adjust = "none",
  format_pvalue = TRUE,
  data = NULL,
  ...
)

## S3 method for class 'posthoc_anova'
print(
  x,
  digits = x$input$digits,
  digits_p = x$input$digits_p,
  digits_param = 2,
  ...
)

## S3 method for class 'posthoc_anova'
plot(
  x,
  ...,
  zero_line_color = "grey",
  add_p = TRUE,
  p_size = 1,
  p_color = "blue",
  p_pos_adj = 0.22,
  flip_xy = TRUE
)

Arguments

y

(numeric|formula)
Either a numeric vector or formula.

group

(factor)
a vector that either is a factor or can be converted into one. If y is a formula, group is ignored.

method

("games-howell"|"tukey")
Name of post-hoc tests to conduct. Valid values are "tukey" and "games-howell".

conf_level

(number)
Confidence level (equals to 1 - alpha, where alpha is significanve level). Number from 0 to 1. Default is 0.95.

digits

(integer)
The number of digits to round data related numbers to.

digits_p

(integer)
The number of digits to round p values to. Must be 2, 3 or more.

p_adjust

Any valid stats::p.adjust() method.

format_pvalue

(does not work yet)
Whether to format the p values according to APA standards (i.e. replace all values lower than .001 with '<.001'). This only applies to the printing of the object, not to the way the p values are stored in the object.

data

(data frame)
a data frame with data to be used in combination with formula.

...

Further arguments to methods.

sep

(character)
A string with a symbol to separate group names if several grouping variables are used.

x

object to print.

zero_line_color

(character) Color for line indicating zero differences.

add_p

(logical) Flag if p values should be added.

p_size

(numeric) Font size to p-values-related text.

p_color

(character) Color for p values.

p_pos_adj

(numeric) Factor for p value position correction

flip_xy

(logical) Flag if x and y axes should be swapped.

Details

The main part of the function code and descriptions were imported from posthocTGH() in package userfriendlyscience.

Value

A list of three elements:

input

List with input arguments

output

List with post-hoc test results

.

Note

Options that carry out Games-Howell and Tukey HSD analyses are based on code of function posthocTGH() in package userfriendlyscience (version 0.7.0).

Author(s)

Gjalt-Jorn Peters (Open University of the Netherlands)
Jeff Bagget (University of Wisconsin - La Crosse)
Vilmantas Gegzna

See Also

Examples

1
2
3
4
5
6
7
library(biostat)

# Compute post-hoc statistics using the Games-Howell method
posthoc_anova(weight ~ Diet, data = ChickWeight, method = "Games-Howell")

# Compute post-hoc statistics using the Tukey method
posthoc_anova(weight ~ Diet, data = ChickWeight, method = "Tukey")

GegznaV/BioStat documentation built on Aug. 14, 2020, 9:30 p.m.