fitted.aovlist {dae}R Documentation

Extract the fitted values for a fitted model from an aovlist object


Extracts the fitted values as the sum of the effects for all the fitted terms in the model, stopping at error.term if this is specified. It is a method for the generic function fitted.


## S3 method for class 'aovlist'
fitted(object, error.term=NULL, ...)



An aovlist object created from a call to aov.


The term from the Error function down to which effects are extracted for adding to the fitted values. The order of terms is as given in the ANOVA table. If error.term is NULL effects are extracted from all Error terms.


Further arguments passed to or from other methods.


A numeric vector of fitted values.


Fitted values will be the sum of effects for terms from the model, but only 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

See Also

fitted.errors, resid.errors, tukey.1df 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,

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

## two equivalent ways of extracting the fitted values
fit  <- fitted.aovlist(RCBDPen.aov)
fit <- fitted(RCBDPen.aov, error.term = "Blend:Flask")

[Package dae version 3.2.19 Index]