Professional Documents
Culture Documents
Two-way ANOVA allows to compare population means when the populations are classied according to two (categorical) factors. Example. We might like to look at SAT scores of students who are male or female (rst factor) and either have or have not had a preparatory course (second factor). Example. A researcher wants to investigate the effects of the amounts of calcium and magnesium in a rats diet on the rats blood pressure. Diets including high, medium and low amounts of each mineral (but otherwise identical) will be fed to the rats. And after a specied time on the diet, the bood pressure wil be measured. Notice that the design includes nine different treatments because there are three levels to each of the two factors.
grand mean
i jk
i
factor effect
j
factor effect
i j
interaction effect
i jk
residual
N (0, ).
Think of this model in terms of making a prediction. Without knowledge of the two factors, our best guess is . If we know about the level of factor A, we can adjust the prediction by adding i . Similarly, knowlede of the level of factor B or knowledge about both provide additional information with which to modify our prediction. We still wont be correct every time, however, because there is random variation within each cell. There are now three sets of hypotheses to test: H0 : no main effect for factor A (i.e. all H0 : no main effect for factor B (i.e. all H0 : no interaction effect (i.e. all are 0) are 0) are 0)
Each of these hypothesis is judged on the basis of a separate F statistic. As usual, we will use two-way ANOVA provided it is reasonable to assume normal group distributions and the ratio of the largest group standard deviation to the smallest group standard deviation is at most 2.
The general layout of the ANOVA table should be familiar to us from the ANOVA tables we have seen for regression and one-way ANOVA. Notice that this time we are dividing the variation into four components:
1. 2. 3. 4.
We can make two different interaction plots from the summary table above:
promos 1 3 5 7
4.6
mean of expPrice
mean of expPrice 1 3 5 7
4.4
4.2
4.0
3.8
3.8
4.0
4.2
4.4
4.6
10
20
30
40
promos
discount
Anova(lm(expPrice ~ promos*discount)) Anova Table (Type II tests) Response: expPrice Sum Sq Df F value promos 8.36 3 47.73 discount 8.31 3 47.42 promos:discount 0.23 9 0.44 Residuals 8.41 144 --Signif. codes: 0 *** 0.001 ** Means: discount promos 10 20 1 4.423 4.225 3 4.284 4.097 5 4.058 3.890 7 3.780 3.760