TukeyHSD.lm: Additional interfaces to TukeyHSD

Description Usage Arguments Examples

View source: R/Tukey.R

Description

TukeyHSD requires use of aov. Since this is a hinderence for beginners, wrappers have been provided to remove this need.

Usage

1
2
3
4
5
6
## S3 method for class 'lm'
TukeyHSD(x, which, ordered = FALSE, conf.level = 0.95, ...)

## S3 method for class 'formula'
TukeyHSD(x, which, ordered = FALSE, conf.level = 0.95,
  data = parent.frame(), ...)

Arguments

x

an object, for example of class lm or formula

which, ordered, conf.level, ...

just as in TukeyHSD from the base package

data

a data frame. NB: This does not come second in the argument list.

Examples

1
2
3
4
5
6
7
## These should all give the same results
if (require(mosaicData)) {
  model <- lm(age ~ substance, data=HELPrct)
  TukeyHSD(model)
  TukeyHSD( age ~ substance, data=HELPrct)
  TukeyHSD(aov(age ~ substance, data=HELPrct))
}

mosaic documentation built on July 26, 2017, 9:02 a.m.