06.09.2021 Views

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16. Factorial ANOVA<br />

Over the course of the last few chapters you can probably detect a general trend. We started out looking<br />

at tools that you can use to compare two groups to one an<strong>other</strong>, most notably the t-test (Chapter 13).<br />

Then, we introduced analysis of variance (ANOVA) as a method <strong>for</strong> comparing more than two groups<br />

(Chapter 14). The chapter on regression (Chapter 15) covered a somewhat different topic, but in doing<br />

so it introduced a powerful new idea: building statistical models that have multiple predictor variables<br />

used to explain a single outcome variable. For instance, a regression model could be used to predict the<br />

number of errors a student makes in a reading comprehension test based on the number of hours they<br />

studied <strong>for</strong> the test, <strong>and</strong> their score on a st<strong>and</strong>ardised IQ test. The goal in this chapter is to import<br />

this idea into the ANOVA framework. For instance, suppose we were interested in using the reading<br />

comprehension test to measure student achievements in three different schools, <strong>and</strong> we suspect that girls<br />

<strong>and</strong> boys are developing at different rates (<strong>and</strong> so would be expected to have different per<strong>for</strong>mance on<br />

average). Each student is classified in two different ways: on the basis of their gender, <strong>and</strong> on the basis of<br />

their school. What we’d like to do is analyse the reading comprehension scores in terms of both of these<br />

grouping variables. The tool <strong>for</strong> doing so is generically referred to as factorial ANOVA. However, since<br />

we have two grouping variables, we sometimes refer to the analysis as a two-way ANOVA, in contrast to<br />

the one-way ANOVAs that we ran in Chapter 14.<br />

16.1<br />

Factorial ANOVA 1: balanced designs, no interactions<br />

When we discussed analysis of variance in Chapter 14, we assumed a fairly simple experimental design:<br />

each person falls into one of several groups, <strong>and</strong> we want to know whether these groups have different<br />

means on some outcome variable. In this section, I’ll discuss a broader class of experimental designs,<br />

known as factorial designs, in we have more than one grouping variable. I gave one example of how<br />

this kind of design might arise above. An<strong>other</strong> example appears in Chapter 14, in which we were looking<br />

at the effect of different drugs on the mood.gain experienced by each person. In that chapter we did find a<br />

significant effect of drug, but at the end of the chapter we also ran an analysis to see if there was an effect<br />

of therapy. We didn’t find one, but there’s something a bit worrying about trying to run two separate<br />

analyses trying to predict the same outcome. Maybe there actually is an effect of therapy on mood gain,<br />

but we couldn’t find it because it was being “hidden” by the effect of drug? In <strong>other</strong> words, we’re going<br />

to want to run a single analysis that includes both drug <strong>and</strong> therapy as predictors. For this analysis each<br />

person is cross-classified by the drug they were given (a factor <strong>with</strong> 3 levels) <strong>and</strong> what therapy they<br />

received (a factor <strong>with</strong> 2 levels). We refer to this as a 3 ˆ 2 factorial design. If we cross-tabulate drug by<br />

therapy, usingthextabs() function (see Section 7.1), we get the following table:<br />

- 497 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!