In chapter 8, we looked at regression models for predicting a quantitative response variable from quantitative predictor variables, but there’s no reason why 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, you’ll treat anxiety disorders, lower blood cholesterol levels, help pregnant mice have fat babies, ensure that pigs grow long in the tooth, facilitate breathing in plants, and learn which grocery shelves to avoid.