Chapter 9. Analysis of variance
This chapter covers
In chapter 7, we looked at regression models for predicting a quantitative response variable from quantitative predictor variables. But there’s no reason that we couldn’t have included nominal or ordinal factors as predictors as well. When factors are included as explanatory variables, our focus usually shifts from prediction to understanding group differences, and the methodology is referred to as analysis of variance (ANOVA). ANOVA methodology is used to analyze a wide variety of experimental and quasi-experimental designs. This chapter provides an overview of R functions for analyzing common research designs.
First we’ll look at design terminology, followed by a general discussion of R’s approach to fitting ANOVA models. Then we’ll explore several examples that illustrate the analysis of common designs. Along the way, we’ll treat anxiety disorders, lower blood cholesterol levels, help pregnant mice have fat babies, assure that pigs grow long in the tooth, facilitate breathing in plants, and learn which grocery shelves to avoid.
In addition to the base installation, we’ll be using the car, gplots, HH, rrcov, and mvoutlier packages in our examples. Be sure to install them before trying out the sample code.