tukey.wrapper: Tukey HSD test and simultaneous confidence intervals for all...

View source: R/Tukey.R

tukey.wrapperR Documentation

Tukey HSD test and simultaneous confidence intervals for all pairs comparisons...

Description

Tukey HSD test and simultaneous confidence intervals for all pairs comparisons in factorial designs. The procedure controls the FWER in the strong sense.

Usage

tukey.wrapper(model, alpha, factorC)

Arguments

model

A fitted model, for example an object returned by lm, glm, or aov etc. It is assumed that coef and vcov methods are available for model. Usually, it is an aov fit

alpha

The significance level

factorC

Specifies a factor

Details

this function, it is possible to compute all pairs comparisons for expectations and simultaneous confidence intervals in factorial linear models. Hereby, the all-pairs comparisons can be performed for user given effects. The overall variance is estimated by the linear model as well as the degree of freedom used by the studentized range distribution.

Value

A list containing:

adjPValues

A numeric vector containing the adjusted pValues

rejected

A logical vector indicating which hypotheses are rejected

confIntervals

A matrix containing the estimates and the lower and upper confidence bound

errorControl

A Mutoss S4 class of type errorControl, containing the type of error controlled by the function.

Author(s)

Frank Konietschke et al.

Examples

data(warpbreaks)
# Tukey contrast on the levels of the factor "Tension"

tukey.wrapper(aov(breaks ~ tension, data = warpbreaks), factorC="tension",alpha=0.05)


# Two-way anova with interaction
tukey.wrapper(aov(breaks ~ tension*wool, data = warpbreaks),alpha=0.05,factorC="tension")
# Two-way anova without interaction

tukey.wrapper(aov(breaks ~ tension+wool, data = warpbreaks),alpha=0.05,factorC="tension")
tukey.wrapper(aov(breaks ~ tension, data = warpbreaks),alpha=0.05,factorC="tension")


data(iris)
tukey.wrapper(lm(Sepal.Length ~ Species, data=iris),alpha=0.05, factorC="Species")

mutoss documentation built on March 31, 2023, 8:46 p.m.