posthocTGH: posthocTGH

Description Usage Arguments Value Examples

View source: R/posthocTGH.R

Description

This function is used by the 'oneway' function for oneway analysis of variance in case a user requests post-hoc tests using the Tukey or Games-Howell methods. This function is a wrapper of userfriendlyscience::posthocTGH by Gjalt-Jorn Peters (Open University of the Netherlands) & Jeff Bagget (University of Wisconsin - La Crosse) Please see userfriendlyscience package.

Usage

1
2
3
4
5
6
7
8
9
posthocTGH(...)

## Default S3 method:
posthocTGH(y, x, method = c("games-howell", "tukey"),
  conf.level = 0.95, digits = 2, p.adjust = "none",
  formatPvalue = TRUE, ...)

## S3 method for class 'formula'
posthocTGH(formula, data, subset, na.action, ...)

Arguments

...

further arguments to be passed to or from methods (this argument is only for formula).

y

y has to be a numeric vector.

x

x has to be vector that either is a factor or can be converted into one.

method

Which post-hoc tests to conduct. Valid values are "tukey" and "games-howell".

conf.level

Confidence level of the confidence intervals.

digits

The number of digits to show in the output.

p.adjust

Any valid p.adjust method.

formatPvalue

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.

formula

A formula specifying the model.

data

an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formula).

subset

an optional vector specifying a subset of observations to be used.

na.action

a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").

Value

A list of three elements:

input

List with input arguments

intermediate

List of intermediate objects.

output

List with two objects 'tukey' and 'games.howell', containing the outcomes for the respective post-hoc tests.

Examples

1
2
3
4
5
6
7
### Compute post-hoc statistics using the tukey method
posthocTGH(y=ChickWeight$weight, x=ChickWeight$Diet, method="tukey")
posthocTGH(weight ~ Diet, data = ChickWeight, method="tukey")

### Compute post-hoc statistics using the games-howell method
posthocTGH(y=ChickWeight$weight, x=ChickWeight$Diet)
posthocTGH(weight ~ Diet, data = ChickWeight)

toshi-ara/compwrap documentation built on May 23, 2019, 8:19 p.m.