\setcounter{chapter}{3}
\chapter{Models for Categorical Experiments}
\chaptermark{Anova -- DRAFT May 25, 1990}
\setcounter{page}{401}

This chapter provides for the modeling of a numeric variable by
one or more categorical variables.
Such data is often the result of a designed
experiment, in which observations of one or more
{\em responses} are made for
changing values of several categories, typically called {\em factors}.
The variation in the response is then studied, in the hope of understanding
how it depends on the underlying phenomena that the levels of
the factors represent.
One of the most important contributions in the history of statistics
was R. A. Fisher's notion that choosing the factors according to
a suitable experimental design could provide more information
on such dependencies than varying only a single factor at a time.
Techniques for  choosing such designs and for analyzing
the results, particularly the analysis of variance, have become an
important part
of scientific studies in agriculture, biology, social sciences, and
increasingly in manufacturing and other applications of engineering and the
physical sciences.

Our goal is a general computing capability for
such data.
We will draw on the ideas of Chapter \DataChapter\ to represent the
experiments, and on those of Chapters \ModelChapter\ and \LinearChapter\ 
to represent and fit the models.
The classical models for designed experiments are very closely
related to those of Chapter \LinearChapter; in fact, most of the
modeling techniques are equivalent to models from that chapter,
but with important differences in how the models are viewed and used.
In addition to modeling techniques, this Chapter contains some
functions to generate common designs and some informal ways to
look at the results of the experiments without using a specific model.

While the motivation and statistical theory arising from experimental
design are central to this chapter, it's worth noting that many of
the techniques work as well for any data in which the behavior of
a numeric response is studied in terms of some categorical predictors.
Most of the computational techniques
are organized to be valid for arbitrary experiments.
However, the statistical techniques sometimes
are invalid, or at least need to be interpreted carefully,
when the assumptions of balanced experiments are not valid.
