Learn R Programming

mutoss (version 0.1-4)

tukey.wrapper: 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

Value

  • A list containing:
  • adjPValuesA numeric vector containing the adjusted pValues
  • rejectedA logical vector indicating which hypotheses are rejected
  • confIntervalsA matrix containing the estimates and the lower and upper confidence bound
  • errorControlA Mutoss S4 class of type errorControl, containing the type of error controlled by the function.

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.

Examples

Run this code
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")

Run the code above in your browser using DataLab