We saw in Chapter 9 that if we include a predictor variable containing two categories into the linear model then the resulting b for that predictor compares the difference between the mean score for the two categories. We also saw in Chapter 10 that if we want to include a categorical predictor that contains more than two categories, this can be achieved by recoding that variable into several categorical predictors each of which has only two categories (dummy coding). We can flip this idea on its head to ask how we can use a linear model to compare differences between the means of more than two groups. The answer is the same: we use dummy coding to represent the groups and stick them in a linear model. Many people are taught that to compare differences between several means we use 'ANOVA' and to look at relationships between variables we use 'regression' (Jane Superbrain Box 11.1). ANOVA and regression are often taught as though they are completely unrelated tests. However, as we have already seen in Chapter 8, we test the fit of a regression model with an ANOVA (the F-test). In fact, ANOVA is just a special case of the linear model (i.e., regression) we have used throughout the book.

There are several good reasons why I think ANOVA is best understood as a linear model. First, it provides a familiar context: I wasted many trees trying to explain regression, so why not use this base of knowledge to explain a new concept (it should make it easier to understand)? Second, the traditional method of teaching ANOVA (known as the variance ratio method) is fine for simple designs, but becomes impossibly cumbersome in more complex situations (such as analysis of covariance). The regression model extends very logically to these more complex designs without anyone needing to get bogged down in mathematics. Finally, the variance ratio method becomes extremely unmanageable in unusual circumstances such as when you have unequal sample sizes.1 The regression method makes these situations considerably simpler. Although these reasons are good enough, SPSS very much deals with ANOVA in a regression-y sort of way (known as the general linear model, or GLM).

I have mentioned that ANOVA is a way of comparing the ratio of systematic variance to unsystematic variance in an experimental study. The ratio of these variances is known as the F-ratio. However, any of you who have read Chapter 8 should recognize the F-ratio (see Section 8.2.4) as a way to assess how well a regression model can predict an outcome compared to the error within that model. If you haven't read Chapter 8 (surely not!), have a look before you carry on (it should only take you a couple of weeks to read). How can the F-ratio be used to test differences between means and whether a regression model fits the data? The answer is that when we test differences between means we are fitting a regression model and using F to see how well it fits the data, but the regression model contains only categorical predictors (i.e., grouping variables). So, just as the t-test could be represented by the linear regression equation (see Section 9.2.2), ANOVA can be represented by the multiple regression equation in which the number of predictors is one less than the number of categories of the independent variable.

Let's take an example. There was a lot of excitement, when I wrote the first edition of this book, surrounding the drug Viagra. Admittedly there's less excitement now, but it has been replaced by an alarming number of spam emails on the subject (for which I'll no doubt be grateful in 15 years' time), so I'm going to stick with the example. Viagra is a sexual stimulant (used to treat impotence) that broke into the black market under the belief that it will make someone a better lover (oddly enough, there was a glut of journalists taking the stuff at the time in the name of 'investigative journalism'... hmmm!). In the psychology literature sexual performance issues have been linked to a loss of libido (Hawton, 1989). Suppose we tested this belief by taking three groups of participants and administering one group with a placebo (such as a sugar pill), one group with a low dose of Viagra and one with a high dose. The dependent variable was an objective measure of libido (I will tell you only that it was measured over the course of a week - the rest I will leave to your own imagination). The data are in Table 11.1 and can be found in the file Viagra.sav (which is described in detail later in this chapter).


1 Having said this, it is well worth the effort in trying to obtain equal sample sizes in your different conditions because unbalanced designs do cause statistical complications (see Section 11.3).