fitted.errors: Extract the fitted values for a fitted model

View source: R/diagnostic.checking.r

fitted.errorsR Documentation

Extract the fitted values for a fitted model

Description

An alias for the generic function fitted. When it is available, the method fitted.aovlist extracts the fitted values, which is provided in the dae package to cover aovlist objects.

Usage

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

Arguments

object

An aovlist object created from a call to aov.

error.term

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.

Value

A numeric vector of fitted values.

Warning

See fitted.aovlist for specific information about fitted values when an Error function is used in the call to the aov function.

Author(s)

Chris Brien

See Also

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

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

dae documentation built on June 22, 2024, 9:07 a.m.