1 An example of a more complex design (a four level nested anova) 0 %, 20% and 40% of a tree’s roots were cut with the purpose to study the influence of water stress on leaf nutrients Each treatment was applied to two randomly selected trees Three randomly selected leaves were sampled per tree From each leaf, two leaf discs were analysed Thus, the total sample consisted of 36 leaf discs
2 40% 20% 0% Four level nested anova Tree (b = 2 ) Replicate (r = 2) Model: β (i)j is ND(0, σ (a)b 2 ) Leaf (c = 3 ) Treatment (a = 3) γ (ij)k is ND(0, σ (ab)c 2 )
3 SourcecdfMSE[MS]F Treatments Trees Leaves Error a-1 a(b-1) ab(c-1) abc(r-1) MS a MS (a)b MS (ab)c MS e bcrσ a 2 +cr σ (a)b 2 + r σ (ab)c 2 +σ 2 cr σ (a)b 2 + r σ (ab)c 2 +σ 2 r σ (ab)c 2 +σ 2 σ 2 MS a /MS (a)b MS (a)b /MS (ab)c MS (ab)c /MS e MS e MS (ab)c = rs (ab)c 2 + s 2 → MS (a)b = cr s (a)b 2 + r s (ab)c 2 +s 2 = cr s (a)b 2 + MS (ab)c → MS a = bcrs a 2 +cr s (a)b 2 + r s (ab)c 2 +s 2 = bcrs a 2 +MS (a)b →
4 How do it with SAS
5 PROC GLM; CLASS treat tree leaf disc; MODEL Nitro = treat tree(treat) leaf(tree treat); /* treatment is a fixed factor, while trees and leaves are random */ RANDOM tree(treat) leaf(tree treat); /* gives the expected means squares */ RUN; DATA nested; /* Nested anova (eks 6-4 in the lecture notes) */ INFILE 'H:\lin-mod\eks6x.prn' firstobs =2 ; INPUT treat $ tree $ leaf $ disc $ Nitro ;
6 General Linear Models Procedure Dependent Variable: NITRO Source DF Sum of Squares Mean Square F Value Pr > F Model Error Corrected Total R-Square C.V. Root MSE NITRO Mean Source DF Type I SS Mean Square F Value Pr > F TREAT TREE(TREAT) LEAF(TREAT*TREE) Source DF Type III SS Mean Square F Value Pr > F TREAT TREE(TREAT) LEAF(TREAT*TREE) NB! These values are based on MS e as the error term, which is wrong!
7 PROC GLM; CLASS treat tree leaf disc; MODEL Nitro = treat tree(treat) leaf(tree treat); /* treatment is a fixed factor, while trees and leaves are random */ RANDOM tree(treat) leaf(tree treat); /* gives the expected means squares */ RUN; DATA nested; /* Nested anova (eks 6-4 in the lecture notes) */ INFILE 'H:\lin-mod\eks6x.prn' firstobs =2 ; INPUT treat $ tree $ leaf $ disc $ Nitro ;
8 General Linear Models Procedure Source Type III Expected Mean Square TREAT Var(Error) + 2 Var(LEAF(TREAT*TREE)) + 6 Var(TREE(TREAT)) + Q(TREAT) TREE(TREAT) Var(Error) + 2 Var(LEAF(TREAT*TREE)) + 6 Var(TREE(TREAT)) LEAF(TREAT*TREE) Var(Error) + 2 Var(LEAF(TREAT*TREE)) bcrτ a 2 +cr σ (a)b 2 + r σ (ab)c 2 +σ 2 cr σ (a)b 2 + r σ (ab)c 2 +σ 2 r σ (ab)c 2 +σ 2
9 PROC GLM; CLASS treat tree leaf disc; MODEL Nitro = treat tree(treat) leaf(tree treat); /* treatment is a fixed factor, while trees and leaves are random */ RANDOM tree(treat) leaf(tree treat); /* gives the expected means squares */ TEST h=treat e= tree(treat); /* tests for the difference between treatments with MS for tree(treat) as denominator */ TEST h= tree(treat) e=leaf(tree treat); /* tests for the difference between trees with MS for leaf(tree treat) as denominator*/
10 General Linear Models Procedure Dependent Variable: NITRO Tests of Hypotheses using the Type III MS for TREE(TREAT) as an error term Source DF Type III SS Mean Square F Value Pr > F TREAT Tests of Hypotheses using the Type III MS for LEAF(TREAT*TREE) as an error term Source DF Type III SS Mean Square F Value Pr > F TREE(TREAT)
11 PROC GLM; CLASS treat tree leaf disc; MODEL Nitro = treat tree(treat) leaf(tree treat); /* treatment is a fixed factor, while trees and leaves are random */ RANDOM tree(treat) leaf(tree treat); /* gives the expected means squares */ TEST h=treat e= tree(treat); /* tests for the difference between treatments with MS for tree(treat) as denominator */ TEST h= tree(treat) e=leaf(tree treat); /* tests for the difference between trees with MS for leaf(tree treat) as denominator*/ MEANS treat / Tukey Dunnett('Control') e= tree(treat) cldiff; /* finds possible significant differences between treatments and the control and the other treatments */ RUN;
12 Tukey's Studentized Range (HSD) Test for variable: NITRO NOTE: This test controls the type I experimentwise error rate. Alpha= 0.05 Confidence= 0.95 df= 3 MSE= Critical Value of Studentized Range= Minimum Significant Difference= Comparisons significant at the 0.05 level are indicated by '***'. Simultaneous Simultaneous Lower Difference Upper TREAT Confidence Between Confidence Comparison Limit Means Limit 20% - 40% % - Control % - 20% % - Control Control - 20% Control - 40%
13 Dunnett's T tests for variable: NITRO NOTE: This tests controls the type I experimentwise error for comparisons of all treatments against a control. Alpha= 0.05 Confidence= 0.95 df= 3 MSE= Critical Value of Dunnett's T= Minimum Significant Difference= Comparisons significant at the 0.05 level are indicated by '***'. Simultaneous Simultaneous Lower Difference Upper TREAT Confidence Between Confidence Comparison Limit Means Limit 20% - Control % - Control
14 PROC NESTED; CLASS treat tree leaf; VAR Nitro; RUN;
15 Coefficients of Expected Mean Squares Source TREAT TREE LEAF ERROR TREAT TREE LEAF ERROR SourcecdfMSE[MS]F Treatments Trees Leaves Error a-1 a(b-1) ab(c-1) abc(r-1) MS a MS (a)b MS (ab)c MS e bcrσ a 2 +cr σ (a)b 2 + r σ (ab)c 2 +σ 2 cr σ (a)b 2 + r σ (ab)c 2 +σ 2 r σ (ab)c 2 +σ 2 σ 2 MS a /MS (a)b MS (a)b /MS (ab)c MS (ab)c /MS e MS e
16 Nested Random Effects Analysis of Variance for Variable NITRO Degrees Variance of Sum of Error Source Freedom Squares F Value Pr > F Term TOTAL TREAT TREE TREE LEAF LEAF ERROR ERROR Variance Variance Percent Source Mean Square Component of Total TOTAL TREAT TREE LEAF ERROR Mean Standard error of mean s 2 =MS e
17 The problem of pseudoreplication
A B C Two-way anova (A fixed, B random) Factor A (drug) Factor B (patient) Replicate 18 measurements If we want to increase the power of the analysis, we may e.g. double the number of measurements But be careful about what you do!
ABC A C B Design 1 Design 2 Both experiments have 36 measurements 3 experimental units/treatment 6 experimental units/treatment Pseudoreplicates Design 2 is best because it uses 6 experimental units/treatment
20 40% 20% 0% Four level nested anova Tree (b = 2 ) Replicate (r = 2) Leaf (c = 3 ) Treatment (a = 3) Trees are the experimental units (2 replicates/treatment) Pseudoreplicates