G. Nested Designs 1 Introduction. 1.1 Definition (Nested Factors) When each level of one factor B is associated with one and only one level of another factor A, we say that B is nested within factor A. 1. Notation Use BωA to denote that B is nested within factor A. 1.3 Example PVPS Example (see Two-Way Fixed-Effects ANOVA Model on pages D. & D3.). Two-Way Nested Designs (Balanced Cases).1 Definition y ijl = µ + α i + β j(i) + ε ijl, i = 1,..., a, j = 1,..., b, l = 1,..., n, where µ = overall population mean α i = ith effect of factor A β j(i) = jth level effect of factor B nested within the ith level of factor A ε ijl = error (N = abn i.i.d. N(0, σ )).. Assumptions 1. Fixed effects case: a α i = 0 (A fixed); β j(i) = 0 for each i = 1,..., a (B is fixed within each level of A).. Random effects case: {α 1,, α a } form a random sample of N(0, σa) (A random); {β 1(i),, β b(i) } form a random sample of N(0, σb ) for each i = 1,..., a (B is random within each level of A); all a + ab + abn r.v. s are independent. 3. Mixed effects model: A is fixed; B is random: a α i = 0; {β 1(i),, β b(i) } form a random sample of N(0, σb ) for each i = 1,..., a; all ab + abn r.v. s are independent. 4. (Rare, not considered here): A is random; B is fixed. G.1
.3 Notation y ij. = l=1 y ijl/n = average response for the jth level of B nested within the ith level of A. y i.. = l=1 y ijl/bn = average response for the ith level of A. y... = a l=1 y ijl/abn = overall sample mean..4 Sums of Squares, Mean Squares, and Computational Formulas 1. SS T = a l=1 (y ijl y... ) = a l=1 y ijl T.../abn. SS E = a l=1 (y ijl y ij. ) ; MS E = SS E /ab(n 1). 3. SS A = a nb(y i.. y... ) = a T i../nb T.../abn; = SS A /(a 1). n(y ij. y i.. ) 4. SS B(A) = a SS B(A) /a(b 1)..5 Theorems 1. SS T = SS A + SS B(A) + SS E. = a. Regardless of which model is correct (in G.): α. SS E /σ χ (ab(n 1)). β. E[MS E ] = σ. Proof: Note that SS E = a l=1 (ε ijl ε ij. )..6 Hypotheses of interest 1. { H A Test A : 0 : α i = 0, i = 1,..., a (fixed) H0 A : σa = 0 (random) T ij./n a T i../nb; =. Test BωA : { H B 0 : β j(i) = 0, i and j (fixed) H0 B : σb = 0 (random).7 Definition If A is fixed: k a = 1 a 1 a α i. If B is fixed: k b = 1 a(b 1) a β j(i). G.
.8 ANOVA Table E[MS] Source SS DF MS fixed random mixed (A fixed, B random) A SS A a 1 σ + nbka σ + nσb + nbσ a σ + nσb + nbk a BωA SS B(A) a(b 1) σ + nkb σ + nσb σ + nσb Residual SS E ab(n 1) MS E σ σ σ Total SS T abn 1.9 More Theorems 1. An α-level test of H B 0 : σ b = 0 or HB 0 : k b = 0 is F = MS E > F α;a(b 1),ab(n 1) regardless of which model is correct.. An α-level test of H A 0 : α i = 0, i = 1,..., a is in the fixed effects models. F = MS E > F α;a 1,ab(n 1) 3. An α-level test of H A 0 : α i = 0, i = 1,..., a is in the mixed effects model. F = 4. An α-level test of H A 0 : σ a = 0 is in the random effects model. F = > F α;a 1,a(b 1) > F α;a 1,a(b 1) 5. For the random effects model: Var(y ijl ) = σ + σ a + σ b = σ tot and the variance components are estimated as: variance component σ σ b σ a σ tot estimate ˆσ = MS E ˆσ b = ( MS E )/n ˆσ a = ( )/nb ˆσ tot = ˆσ + ˆσ b + ˆσ b proportion ˆσ /ˆσ tot ˆσ b /ˆσ tot ˆσ a/ˆσ tot of ˆσ tot G.3
.10 PVPS Example, revisited Consider again the PVPS Example (pp. D. & D.3) with a = schools b = 3 classes/school n = 4 students per class/school y ijl = reading achievement score Assume the following pseudo data: S 1 S C 1 C C 3 C 4 C 5 C 6 1 15 10 18 0 19 13 19 1 0 14 11 17 11 1 17 1 1 17 17 16 15 1 T ij. 48 68 50 75 66 83 T i.. 166 4 T... = 390 SS T = 3 4 l=1 y ijl T.../4 = 6654 390 /4 = 6654 6337.5 = 316.5 SS A = T SS B(A) = i../1 T.../4 = (166 + 4 )/1 6337.5 = 6477.67 6337.5 = 140.17 3 T ij./4 T i../1 = (48 +68 +50 +75 +66 +83 )/4 6477.67 = 96.83 SS E = SS T SS A SS B(A) = 79.50. AOV Table E(MS) Source SS DF MS fixed random mixed School 140.17 1 140.170 σ + 1 α i σ + 4σ b + 1σ a σ + 4σ b + 1 α i Class(School) 96.83 4 4.08 σ + 3 β j(i) σ + 4σb σ + 4σb Residual 79.50 18 4.417 σ σ σ Total 316.5 3 1. Case 1: Fixed effects School: /MS E = 31.73 > 4.41 = F.05;1,18 significant Class: /MS E = 5.48 >.93 = F.05;4,18 significant.. Case : Random effects School: / = 5.79 7.71 = F.05;1,4 insignificant. Class: Same as case 1. 3. Case 3: Mixed effects School: same as case. Class: same as case 1. G.4
.11 Inferences About the Fixed Factor Means For the fixed effects model and the mixed effects model, we make statistical inferences about the fixed A means: µ i = µ + α i for i = 1,..., a as follows. Let L = a h iµ i be a contrast ( a h i = 0) and ˆL = a h iy i.. { a std.err(ˆl) = h i /(nb) MS E, fixed effects a h i /(nb), random effects For the stage tests of H 0 : α i = α i, the following α-level procedures are used in the α-level protected LSD tests of H0 A : α 1 = = α a = 0 y i.. y i.. > t MSE α/;ab(n 1), if fixed effects /nb y i.. y i.. > t MSB(A) α/;a(b 1), /nb if random effects In the fixed-effects model stage tests of H 0 : µ ij = µ ij H 0 : β j(i) = β j (i), comparing the nested j and j levels of B within the ith level of A, are wanted. An α-level test of H 0 : µ ij = µ ij is y ij. y ij. > t α/;ab(n 1) MS E n For the fixed-effects cases Levene s test of H 0 : σij = σ for all i = 1,..., a, and j = 1,..., b can be obtained by inputting the k = ab groups of data into AOV, where the data for the (i, j)th group is y ij1,..., y ijn with s ij = l=1 (y ijl y ij. ) /(n 1) for i = 1,..., a, and j = 1,..., b. If L-prob. is insignificant at α =.5, then the stage tests of H 0 : α i = α i and H 0 : µ ij = µ ij using MS E are valid; otherwise these procedures are not valid. For the mixed model, Levene s procedure is not valid. The test for appropriateness of the use of as the stage error-term is open for these cases..1 Spray Example We consider a study of three different sprays used on trees. Each of the three sprays was applied to four trees. After one week the concentration of nitrogen was measured in each of six leaves picked in a random way from each tree. Here the experimental units are the 1 trees; we consider them to have been chosen at random from a large population of trees. The leaves thus form four subsamples, each consisting of six leaves from a large population of leaves on the particular tree. Note that in this experiment 1 trees were sprayed and 7 leaves were picked. Each measurement of nitrogen concentration is denoted by y ijk, where i, the number of the treatment, runs from 1 to a; j, the number of the experimental unit for the ith treatment, runs from 1 to b; and k, the observation number from the jth experimental unit on the ith treatment, runs from 1 to n. y ijk : the nitrogen concentration of the kth leaf from the jth tree that received spray i. G.5
See computer example online..13 Proofs of Theorems in G..9 TREE SPRAY Leaf 1 3 4 1 4.50 5.78 13.3 11.59 7.04 7.69 15.05 8.96 1 3 4.98 1.68 1.67 10.95 4 5.48 5.89 1.4 9.87 5 6.54 4.07 10.03 10.48 6 7.0 4.08 13.50 1.79 1 15.3 14.53 10.89 15.1 14.97 14.51 10.7 13.79 3 14.81 1.61 1.1 15.3 4 14.6 16.13 1.77 11.95 5 15.88 13.65 10.45 1.56 6 16.01 14.78 11.44 15.31 1 7.18 6.70 5.94 4.08 7.98 8.8 5.78 5.46 3 3 5.51 6.99 7.59 5.40 4 7.48 6.40 7.1 6.85 5 7.55 4.96 6.1 7.74 6 5.64 7.03 7.13 6.81 1. Case 1: Fixed effects model. claim #1: SS B(A) /σ χ (a(b 1), λ = a nβ j(i) /σ ): SS B(A) /σ = a n/σ (y ij. y i.. ) = a n/σ b [(β j(i) + ε ij. ) ε i.. ] = a n/σ b (X ij X i. ), where β j(i) + ε ij. = X ij, X i. = ε i.., X i1,..., X ib are independent, X ij N(β j(i), σ /n) and X i. = X ij/b. So, Q i /σ = n/σ (X ij X i. ) χ (b 1, λ i = n/σ β j(i) ) for i = 1,..., a. Since the ε ijl s are independent and Q 1,..., Q a are functions of distinct ε ijl s, Q 1,..., Q a are independent. Therefore, SS B(A) /σ = a Q i/σ = sum of a independent non-central chi-square distributions, where Q i /σ is χ (b 1, λ i ). Consequently, SS B(A) /σ χ (a(b 1), λ = a λ i) χ (a(b 1), n/σ a β j(i) ). claim #: SS B(A) /σ = n/σ a [(β j(i) + ε ij. ) ε i.. ] and SS E /σ = 1/σ a l=1 (ε ijl ε ij. ) are independent: SS B(A) = f 1 (ε ij. ε i.. ) and SS E = f (ε ijl ε ij. ). SS B(A) and SS E are independent since ε ij. ε i.. and ε ijl ε ij. are orthogonal classes of contrasts when the ε ijl s are i.i.d. (why?) The fact that /MS E is non-central F (a(b 1), ab(n 1); n/σ a β j(i) ) G.6
follows from the above claims. It follows that /MS E is F (a(b 1), ab(n 1)) when H0 B : β j(i) = 0, i, j. Case : Random effects model. claim #3: SS B(A) /(σ + nσ b ) χ (a(b 1)) (proof: exercise). claim #4: SS B(A) and SS E are independent under the random effects model (proof:exercise). It follows from claims #3 and #4 that MS E σ σ + nσ b F (a(b 1), ab(n 1)) and that /MS E F (a(b 1), ab(n 1)) when H0 B : σb = 0 is true. Case 3: Mixed effects model. The result for the mixed effects model holds because this is identical to the distributional properties for the random effects cases.. The distributions of and MS E under the nested model are exactly equivalent to the distributions of and MS E under the balanced two-way fixed model (completely crossed). 3. SS A = nb a (y i.. y... ) = nb a [(α i+β.(i) +ε i.. ) (β.(.) +ε... )]. y i.. s are independent N(µ + α i, σ b /b + σ /bn). So, a (y i.. y... ) σ b /b + σ /bn = SS A σ + nσ b χ nb (a 1, σ + nσb a αi ) χ (a 1, nb(a 1) k σ + nσ a) b when B(A) is random, we have SS B(A) /(σ + nσ b ) χ (a(b 1)) (claim #3 above). Finally, SS A = f 1 (β.(i) β.(.), ε i.. ε... ) and SS B(A) = f (β j(i) β.(i), ε ij. ε i.. ). It can be shown under the mixed effects model that β.(i) β.(.), ε i.. ε..., β j(i) β.(i), and ε ij. ε i.. are four orthogonal classes of r.v. s. Hence, SS A and SS B(A) are independent. Hence, F (a 1, a(b 1); nb σ + nσ b a αi ) and F (a 1, a(b 1)) under H A 0 : α 1 = = α a = 0. G.7