tukey.1df | R Documentation |
Performs Tukey's one-degree-of-freedom-test-for-nonadditivity on a set of residuals from an analysis of variance.
tukey.1df(aov.obj, data, error.term="Within")
aov.obj |
An |
error.term |
The term from the |
data |
A |
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.
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.
Chris Brien
fitted.errors
, resid.errors
in package dae.
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.