tukey.1df {dae}R Documentation

Performs Tukey's one-degree-of-freedom-test-for-nonadditivity

Description

Performs Tukey's one-degree-of-freedom-test-for-nonadditivity on a set of residuals from an analysis of variance.

Usage

tukey.1df(aov.obj, data, error.term="Within")

Arguments

aov.obj

An aov object or aovlist object created from a call to aov.

error.term

The term from the Error function whose residuals are to be tested for nonadditivity. Only required when the Error function used in call to aov, so that an aovlist object is created.

data

A data.frame containing the original response variable and factors used in the call to aov.

Value

A list containing Tukey.SS, Tukey.F, Tukey.p, Devn.SSq being the SSq for the 1df test, F value for test and the p-value for the test.

Note

In computing the test quantities fitted values must be obtained. If error.term is specified, fitted values will be the sum of effects extracted from terms from the Error function, but only down to that specified by error.term.The order of terms is as given in the ANOVA table. If error.term is unspecified, all effects for terms external to any Error terms are extracted and summed.

Extracted effects will only be for terms external to any Error function. If you want effects for terms in the Error function to be included, put them both inside and outside the Error function so they are occur twice.

Author(s)

Chris Brien

See Also

fitted.errors, resid.errors in package dae.

Examples

## set up data frame for randomized complete block design in Table 4.4 from 
## Box, Hunter and Hunter (2005) Statistics for Experimenters. 2nd edn 
## New York, Wiley.
RCBDPen.dat <- fac.gen(list(Blend=5, Flask=4))
RCBDPen.dat$Treat <- factor(rep(c("A","B","C","D"), times=5))
RCBDPen.dat$Yield <- c(89,88,97,94,84,77,92,79,81,87,87,
                       85,87,92,89,84,79,81,80,88)

## perform the analysis of variance
RCBDPen.aov <- aov(Yield ~ Blend + Treat + Error(Blend/Flask), RCBDPen.dat)
summary(RCBDPen.aov)

## Obtain the quantities for Tukey's test
tukey.1df(RCBDPen.aov, RCBDPen.dat, error.term = "Blend:Flask")

[Package dae version 3.2.28 Index]