TWO WAY ANOVA Next we consder the case when we have two factors, categorzatons, e.g. lab and manufacturer. If there are I levels n the frst factor and J levels n the second factor then we can thnk of ths stuaton as one where there are I J levels of the combned factors. Notaton Notaton-wse, we smply add another subscrpt to the response, that s, y now has a trple subscrpt, where y,,k represents the measurement on the kth subect that belongs to both the th group (lab) of the frst factor and the group (manufacturer) of the second factor, =,... I, =,..., J, and k =,..., n. For smplcty, we wll only work wth the specal case of n, = K,.e. all subgroups have the same number of responses. Then we wrte the model as follows: y,,k = α + η, + E,,k So, when = and =, y,,k = and when = 2 and =, y 2,,k = + E,.k + E 2,.k Agan, we need a constrant because our model s over-parameterzed. We add the constrant that η, = 0. A Smpler Sub-model In our example of the study of the measurement process, we fnd that wth 7 labs and 4 manufacturers, we have 28 levels. If the effect of the lab s the same, regardless of whch manufacturer the tablets are comng from, and f the effect of the manufacturer s the same regardless of whch lab s measurng the tablets then we could express the model as y,,k = α + β + γ + E,,k
Note that now we have only I + J levels, rather than I J. Ths model s called an addtve model. It puts structure on the levels. That s the dfference between measurements at LAb and Lab 2 of tablets from Manufacturer A s β 2 β, and ths dfference s the same for the measurements at Labs and 2 for tablets from Manufacturer B,.e. there s no nteracton between lab and manufacturer. Degrees of Freedom To see that the addtve model s a sub-model of the full model, we can we express the full model as follows: y,,k = α + β + γ + ν, + E,,k Now agan, we need to put constrants on the parameterzaton. If we thnk about t from the geometrc perspectve, we see that the vector les n both the space spanned by the lab ndcators (the e ) and the space spanned by the manufacturer ndcators (the u ). So, the vector, and I of the e vectors and J of the u vectors are all that s needed for the addtve part of the model. As for the rest, suppose we have vectors v, that ndcate whether a response belongs n group, or not. Note that v, =, and and that v, =. So we need only of these I J vectors. All together that gves us + (I ) + ( ) + ( ) = ( ) of the + I + J + IJ vectors. If we are to put all of the parameters n then we must add constrants. Tradtonally these are β = 0 γ = 0 2
= 0, for = 0, for How many constrants do we have? Sums of Squares The Anova table of the sums of squared devatons helps us assess whether the smple addtve model s adequate to descrbe the varaton n the means, and whether there s a lab effect or a manufacturer effect (.e. whether all of the β = 0 or all of the γ = 0). The decomposton of the sums of squares s a bt more complex here. Frst we need to ntroduce some more notaton, ȳ.. = ȳ. = ȳ. = IJK JK y k y k, for =... I ȳ = Now let s look at the sums of squares: (y k ȳ.. ) 2 To begn, let s add and subtract the IJ means ȳ. 3
(y k ȳ.. ) 2 = (y k ȳ ) 2 + (ȳ ȳ.. ) 2 Show that the cross product term s 0. We call the frst sum on the rght-hand sde of the equaton the error sum of squares, or SS E. We want to further decompose the second term. (ȳ ȳ.. ) 2 What do we add and subtract ȳ. or ȳ.? Both: (ȳ ȳ. ȳ. + ȳ.. + ȳ. ȳ.. + ȳ. ȳ.. ) 2 = K(ȳ ȳ. ȳ. + ȳ.. ) 2 + JK(ȳ. ȳ.. ) 2 + IK(ȳ. ȳ.. ) 2 The three terms on the rght-hand sde of the equalty are called, the nteracton sum of squares, or SS LM, the sum of squares due to Lab, or SS L, and the sum of squares due to Manufacturer, or 4
SS M. Show that the cross products are all 0. ANOVA Table Arrange the sum of squares nto an ANOVA table. Source DF Sum of Squares Mean Square F-statstc Labs Manufacturer 3 Interacton 8 Error 60 Total 85 The frst F statstc s used to test whether there s a dfference between labs,.e. whether there s a lab effect. The second F statstc s used to test whether there s a dfference between manufactureres. The thrd s to test the addtve model,.e. s there an nteracton between lab and manufacturer. 5