Random and Mixed Effects ANOVA KNNL – Chapter 25 1-Way Random Effects Model • In some settings, the levels of the factor in a 1-Way ANOVA model are a random sample from a larger population of levels • Goal is to make statements regarding the population of levels, as opposed to only regarding the levels in the study. • We wish to make statements about the variation in the effects of the levels • Studies are often interested in measuring reliability of testing/measuring procedures Statistical Model / Parameters of Interest Yij i ij i 1,..., r; j 1,..., n i ~ N , 2 independent ij ~ N 0, 2 independent Overall Mean 2 Between Group Variance i , ij are independent 2 Within Group Variance E Yij E i ij E i E ij 0 2 Yij 2 i ij 2 i 2 ij 2 i , ij 2 2 2(0) 2 2 Y2 Yij , Yij ' i ij , i ij ' i , i i , ij ' ij , i ij , ij ' 2 0 0 0 2 Yij , Yi ' j ' 0 i i ' r 2, n 2 : Y11 Y Y 12 Y21 Y22 Y2 2 0 0 2 2 0 0 Y 2 Y 2 2 0 0 Y 2 2 0 0 Y Yij , Yij ' 2 Intraclass Correlation Coefficient: I Yij , Yij ' Yij Yij ' Y2 j j' Analysis of Variance - I E Yij 2 Yij Y2 2 2 Yij , Yij ' 2 Yij , Yi ' j ' 0 i i ' r n SSE Yij Y i i 1 j 1 r n SSTR Y i Y i 1 j 1 SSE 2 E MSE E r n 1 df E r n 1 2 2 r n Y i Y i 1 2 dfTR r 1 SSTR 2 2 E MSTR E n r 1 Testing whether all i are equal: H 0 : 2 0 H A : 2 0 Test Statistic: F * Reject H 0 if F * F 0.95; r 1, r n 1 MSTR MSE Elements of the Derivations of E MSTR and E MSE : E Yij 2 Yij 2 2 E Yij2 2 2 2 E Y i Y i 2 1 n E Yij n j 1 n 1 n 1 n 1 n 1 Yij 2 2 Yij 2 Yij , Yij ' 2 j 1 j ' j 1 n j 1 n j 1 n 2 E Y i 2 2 n n 1 2 n 2 2 2 2 n 2 n 2 n 2 2 n 2 2 2 2 r r 1 r 1 r 1 r 2 1 n r r 1 n 2 2 1 E Y E Y i Y Y i 2 Y i 2 Y i , Y i ' 2 r 2 (0) n 2 nr i 1 i 'i 1 r i 1 r i 1 r i 1 r n 2 2 2 2 E Y nr Analysis of Variance - II E Yij 2 Yij Y2 2 2 Yij , Yij ' 2 Yij , Yi ' j ' 0 i i ' r n SSE Yij Y i r n r Yij2 n Y i df E r n 1 SSTR Y i Y r E Y 2 i 1 j 1 r n i 1 j 1 2 ij 2 2 2 i 1 j 1 2 r 2 i 1 n Y i Y i 1 n Y i nrY 2 2 2 i 1 E Y 2 i 2 n 2 2 n dfTR r 1 E Y 2 2 n 2 2 nr r n 2 2 E Yij nr nr 2 nr 2 i 1 j 1 r 2 2 E n Y i nr nr 2 r 2 i 1 2 2 E SSE nr nr 2 nr 2 nr nr 2 r 2 r n 1 2 SSE 2 E MSE E r n 1 2 2 E SSTR nr nr 2 r 2 nr n 2 2 n r 1 2 r 1 2 SSTR 2 2 E MSTR E n r 1 E nrY nr n 2 2 2 2 Estimating Overall Mean • E Yij 2 Yij Y2 2 2 Yij , Yij ' 2 Yij , Yi ' j ' 0 i i ' E Y i 1 n E Yij n j 1 s 2 Y i E Y s Y MSTR nr ~ t r 1 Y 2 s Y n 2 2 n MSTR n s Y i 1 r E Y i r i 1 s 2 Y Y MSTR n Y i 2 n 2 2 nr MSTR nr 1 100% CI for : Y t 1 / 2 ; r 1 s Y Estimating Intra-Class Correlation I = 2 / Y2 SSE SSE 2 2 E MSE E ~ r n 1 2 r n 1 SSTR SSTR 2 2 E MSTR E ~ 2 r 1 n 2 2 n r 1 SSTR MSTR r 1 2 2 2 2 n n ~ F r 1, r n 1 SSTR, SSE independent SSE MSE 2 r n 1 2 MSTR 2 2 n F 1 ( 2); r 1, r n 1 1 P F 2; r 1, r n 1 MSE 2 1 MSTR 1 1 MSTR 1 Setting: L U 1 1 n MSE F 1 ( 2); r 1, r n 1 n MSE F / 2; r 1, r n 1 2 L U ,U* 1 100% CI for I 2 2 : L* 1 L 1U Estimating Within Group Variance: 2 SSE 2 ~ 2 r n 1 SSE P 2 / 2 ; r n 1 2 2 1 / 2 ; r n 1 1 2 / 2 ; r n 1 1 2 1 / 2 ; r n 1 P 2 1 SSE SSE SSE SSE 2 P 2 2 1 1 / 2 ; r n 1 / 2 ; r n 1 SSE 1 100% CI for : 2 1 / 2 ; r n 1 r n 1 MSE r n 1 MSE 2 , 2 1 / 2 ; r n 1 / 2 ; r n 1 2 SSE , 2 / 2 ; r n 1 Estimating Between Group Variance: 2 E MSTR 2 n 2 E MSE 2 MSTR MSE E MSTR E MSE 1 1 E 2 E MSTR E MSE n n n n MSTR MSE Point Estimator: s2 Note: This can be negative (usually treated as 0). n Aside :Satterthwaite approximation for Degrees of Freedom (ci are constants) h L ci E MSi i 1 ^ ^ h (df ) L Approx 2 ~ df L L ci MSi i 1 c1MS1 ... ch MSh 2 2 c1MS1 ... ch MSh 2 where: df df1 df h ^ ^ (df ) L (df ) L P 2 L 2 1 / 2; df 1 / 2 ; df ^ ^ ( df ) L ( df ) L 1 100% CI for L : , 2 2 1 / 2 ; df / 2; df 1 1 Application to estimating 2 : h 2, c1 c2 MS1 MSTR MS 2 MSE n n MSTR MSE L s n ^ 2 ns 2 df 2 MSTR r 1 2 MSE r n 1 2 2-Way Random Effects Model Factors A and B Both Random (Levels are Random Samples from Populations) Yijk i j ij ijk i 1,..., a j 1,..., b k 1,..., n i , j , ij are independent, normally distributed, with mean 0, and Variances: 2 , 2 , 2 ijk ~ N 0, 2 independent i , j , ij , ijk pairwise independent E Yijk E i j ij ijk 2 2 Yijk 2 i j ij ijk 2 2 2 2 2 2 2 2 2 2 Yijk , Yi ' j ' k ' 2 2 0 i i ', j j ', k k ' i i ', j j ', k k ' i i ', j j ', k , k ' i i ', j j ', k , k ' i i ', j j ', k , k ' 2-Way Mixed Effects Model Factor A Fixed, B Random (Restricted Model) Yijk i j ij ijk i 1,..., a are independent, normal, with mean 0, and Variance: a i are fixed constants with i 0 j i 1 ij a 1 2 ~ N 0, a ijk ~ N 0, 2 independent a s.t. j 1,..., b k 1,..., n i 1 ij 1 2 0 and ij , i ' j a , , pairwise independent j ijk ij E Yijk E i j ij ijk i 2 Yijk 2 i j ij ijk 2 2 a 1 2 2 a 2 a 1 2 a Yijk , Yi ' j ' k ' 1 2 2 a 0 a 1 2 2 a i i ', j j ', k k ' i i ', j j ', k k ' i i ', j j ', k , k ' j j ', i, i ', k , k ' Note: Unrestricted Model: Yijk i *j ij ijk * j *j * j ij ij j * * ij ~ N 0, 2 * independent 2 Expected Mean Squares for 2-Way ANOVA Mean Square df Fixed Model Random Model Mixed Model (A Fixed, B Fixed) (A Random, B Random) (A Fixed, B Random) a MSA a -1 2+ bn i 1 a 2 i 2 2 n bn 2 a 1 2 2 n b MSB b -1 2+ an j2 j 1 b 1 a MSAB MSE a 1 b 1 ab n 1 2+ 2 2 n an 2 b n ij i 1 j 1 2 a 1 b 1 2 2 an 2 2 2 n 2 2 2 n 2 bn i2 i 1 a 1 Tests for Main Effects and Interactions Tested Effects Factor A Fixed Effects H 0 : 1 ... a 0 Test Statistic FA MSA / MSE Critical Value F 1 ; a 1, ab n 1 Factor B H 0 : 2 0 FB MSB / MSE Critical Value F 1 ; b 1, ab n 1 Mixed Effects (A Fixed) H 0 : 1 ... a 0 FA MSA / MSAB FA MSA / MSAB F 1 ; a 1, a 1 b 1 F 1 ; a 1, a 1 b 1 H 0 : 1 ... b 0 Test Statistic Interaction AB Random Effects H 0 : 2 0 FB MSB / MSAB F 1 ; b 1, a 1 b 1 H 0 : 11 ... ab 0 Test Statistic FAB MSAB / MSE Critical Value F 1 ; a 1 b 1 , ab n 1 2 H 0 : 0 FAB MSAB / MSE H 0 : 2 0 FB MSB / MSE F 1 ; b 1, ab n 1 2 H 0 : 0 FAB MSAB / MSE F 1 ; a 1 b 1 , ab n 1 F 1 ; a 1 b 1 , ab n 1 Estimating Variance Components Case 1: Random Effects Models: E MSE 2 2 E MSAB 2 n s 2 MSE 2 s 2 E MSA 2 n bn 2 2 E MSB 2 n an 2 MSAB MSE n MSA MSAB s2 bn MSB MSAB s2 an Case 1: Mixed Effects Models (B Random): E MSE 2 2 E MSAB 2 n E MSB 2 an 2 s 2 MSE MSAB MSE n MSB MSE s2 an 2 s Estimating Fixed Effects in Mixed Model i Effect of i th Level of Factor A (Fixed Effect) ^ i Y i Y ^ i 2 2 2 n bn E MSAB bn a a Contrast among Levels of Factor A: L ci i ^ a ^ L ci i i 1 2 a ^ ^ L c i i 1 a 2 i 1 100% CI for L ci i : i 1 2 i 1 ^ s i 2 s.t. c i 1 i 0 MSAB a 2 s L ci bn i 1 2 MSAB bn ^ ^ ^ L t 1 / 2 ; a 1 b 1 s L Multiple Comparison Procedures (all pairs of levels of Factor A): Tukey: HSD q 1 ; a, a 1 b 1 MSAB bn Bonferroni: MSD t 1 / 2C A ; a 1 b 1 2 MSAB bn a a a 1 CA 2 2 Estimating Marginal (Factor A) Means in Mixed Models ^ i Y i 2 ^ i ^ a 1 1 a 1 1 2 E MSAB E MSB s i MSAB MSB nab nab nab nab Using Satterthwaite's Approximation: 1 a 1 MSAB MSB nab nab df 2 2 a 1 1 MSAB MSB nab nab b 1 a 1 b 1 2 ^ ^ Approximate 1 100% CI for i : i t 1 / 2 ; df s i