Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Experimental design and statistical analyses of data Lesson 5: Mixed models Nested anovas Split-plot designs.

Similar presentations


Presentation on theme: "1 Experimental design and statistical analyses of data Lesson 5: Mixed models Nested anovas Split-plot designs."— Presentation transcript:

1

2 1 Experimental design and statistical analyses of data Lesson 5: Mixed models Nested anovas Split-plot designs

3 2 Randomized block design All treatments are allocated to the same experimental units Treatments are allocated at random BCB ABD DAA CDC Blocks (b = 3) Treatments (a = 4)

4 3 Treatments Patient ABCDAverage 1 2 3 Blocks (patients) Treatments (drugs)

5 4 An alternative way of writing a GLM Response of patient j receiving drug i Overall mean Effect of drug i Effect of patient j Residual α i = μ i - μ β j = μ j - μ

6 5 Predicted value of y α i = μ i - μ β j = μ j - μ Response of patient j receiving drug i

7 6 Treatments Patient ABCD 15.175.214.914.745.008 26.237.346.186.316.515 34.934.554.644.614.683 5.4435.7005.2435.2205.402

8 7 Treatments Patient ABCD 15.175.214.914.745.008 26.237.346.186.316.515 34.934.554.644.614.683 5.4435.7005.2435.2205.402

9 8 Effects of drugs Effects of patients Ex: Patient 2 receiving treatment C:

10 9 Consider the two questions: Are the three patients different? Are patients in general different? In the first case, ”patients” is considered as a fixed factor In the second case, ”patients” is considered as a random factor

11 10 ”Patients” is a random effect: β j is assumed to be iid ND(0,σ b 2 ) Probability of β If patients are randomly chosen, β j will be a stochastic variable i.e. independently and identically normally distributed with zero mean and variance σ² b

12 11 V(y) = V(μ + α i + β j + ε) = V(μ)+ V(α i )+ V( β j )+ V(ε) = σ a 2 + σ b 2 + σ 2 Variances Variance due to drug (factor a) Variance due to patient (factor b) Residual variance

13 12 Both factors are fixed V(y) = V(μ + α i + β j + ε) = V(μ)+ V(α i )+ V( β j )+ V(ε) = σ a 2 + σ b 2 + σ 2 V(y) = σ 2 Variance of a single observation: Variance of an average:

14 13 ”Patients” is a random factor (mixed anova) V(y) = V(μ + α i + β j + ε) = V(μ)+ V(α i )+ V( β j )+ V(ε) = σ a 2 + σ b 2 + σ 2 V(y) = σ b 2 + σ 2 Variance of a single observation: Variance of an average:

15 14 Both factors are random V(y) = V(μ + α i + β j + ε) = V(μ)+ V(α i )+ V( β j )+ V(ε) = σ a 2 + σ b 2 + σ 2 V(y) = σ a 2 +σ b 2 + σ 2 Variance of a single observation: Variance of an average:

16 15 SourcedfMSE[MS]F Drugs Patients Error a-1 b-1 (a-1)(b-1) MS a MS b MS e Totalab-1 Expected Means Squares

17 16 Expected Mean Squares E[MS a ] = bσ a 2 + σ 2 E[MS b ] = aσ b 2 + σ 2 E[MS e ] = σ 2 df = a-1 df = b-1 df = (a-1)(b-1) H 0 : α A = α B = α C = α D = 0→σ a 2 = 0 → H 0 : β 1 = β 2 = β 3 = 0→σ b 2 = 0 →

18 17 SourcedfMSE[MS]F Drugs Patients Error a-1 b-1 (a-1)(b-1) MS a MS b MS e bσ a 2 + σ 2 aσ b 2 + σ 2 σ 2 MS a /Ms e MS b /MS e Totalab-1

19 18 SourcedfMSE[MS]F Drugs Patients Error 326326 0.149 3.824 0.117 bσ a 2 + σ 2 aσ b 2 + σ 2 σ 2 MS a /Ms e MS b /MS e Total11

20 19 Hvis ”patients” is a random factor, σ b 2 is estimated from E[MS b ] = aσ b 2 + σ 2 → V(y) = σ b 2 + σ 2 = 0.927+0.117 = 1.044Variance of a single observation: Variance of the average:

21 20 How to do it with SAS

22 21 DATA eks5_1; INPUT pat $ treat $ y; /* indlæser data */ CARDS; /* her kommer data. Kan også indlæses fra en fil */ 1 A 5.17 2 A 6.23 3 A 4.93 1 B 5.21 2 B 7.34 3 B 4.55 1 C 4.91 2 C 6.18 3 C 4.64 1 D 4.74 2 D 6.31 3 D 4.61 ; PROC GLM; /* procedure General Linear Models */ TITLE 'Eksempel 5.1'; /* medtages hvis der ønskes en titel */ CLASS pat treat; /* pat og treat er klasse (kvalitative) variable */ MODEL y = pat treat; RANDOM pat; /* Patienter er en tilfældig faktor */ RUN;

23 22 Eksempel 5.1 8 13:18 Monday, November 5, 2001 General Linear Models Procedure Dependent Variable: Y Source DF Sum of Squares Mean Square F Value Pr > F Model 5 8.09475000 1.61895000 13.80 0.0031 Error 6 0.70401667 0.11733611 Corrected Total 11 8.79876667 R-Square C.V. Root MSE Y Mean 0.919987 6.341443 0.34254359 5.40166667 Source DF Type I SS Mean Square F Value Pr > F PAT 2 7.64831667 3.82415833 32.59 0.0006 TREAT 3 0.44643333 0.14881111 1.27 0.3666 Source DF Type III SS Mean Square F Value Pr > F PAT 2 7.64831667 3.82415833 32.59 0.0006 TREAT 3 0.44643333 0.14881111 1.27 0.3666 MS b MS a MS e

24 23 Eksempel 5.1 18 09:00 Friday, November 16, 2001 General Linear Models Procedure Source Type III Expected Mean Square PAT Var(Error) + 4 Var(PAT) TREAT Var(Error) + Q(TREAT)

25 24 Nested designs

26 25 1 2 1 2 1 2 1 2 1 2 1 2 1 2 3 1 2 3 A B C D Factor A (drug) Factor B (patient) Replicate Model: 1 2 1 2 1 2 1 2 1 2 1 2 A B C D Factor A (drug) Factor B (patient) Replicate Model: 1 2 3 1 2 3 Patient j is the same for all drugsPatient j is not the same for all drugs Patients are said to be nested within drugsReplicates can also be regarded as nested within drugs and patients

27 26 Rules for finding the EMS (after Dunn and Clark) 1.For each effect, write down every possible variance component containing every letter of the effect name. For example, in a two way design with r replicates per cell, the EMS for factor A includes σ a 2, σ ab 2 and σ (ab)e 2, but not σ b 2 2.For any nested factor add in parentheses to the effect name the name(s) of the factor within it is nested e.g if B is nested in A, σ (a)b 2 is the variance of β (i)j. 3.For the coefficient of each variance component, use all letters not in the subscripts of the variance component 4.For each variance component, look at any subscripts outside parentheses that are not in the effect name; if any of these letters corresponds to a fixed effect, omit that variance component

28 27 1 2 1 2 1 2 1 2 1 2 1 2 1 2 3 1 2 3 A B C D Two-way anova (A and B fixed) Factor A (drug) Factor B (patient) Replicate Model: Interaction between drug and patient Residual of the kth replicate nested within drug i and patient j

29 28 Model: (1) For each effect, write down every possible variance component containing every letter of the effect name. For example, in a two way design with r replicates per cell, the EMS for factor A includes σ a 2, σ ab 2 and σ (ab)e 2, but not σ b 2 σ a 2 + σ ab 2 + σ (ab)e 2 Factor A: σ b 2 + σ ab 2 + σ (ab)e 2 Factor B: σ ab 2 + σ (ab)e 2 Factor AB: σ (ab)e 2 Residual:

30 29 Model: σ a 2 + σ ab 2 + σ (ab)e 2 σ b 2 + σ ab 2 + σ (ab)e 2 σ ab 2 + σ (ab)e 2 Factor A: Factor B: Factor AB: (2) For any nested factor add in parentheses to the effect name the name(s) of the factor within it is nested e.g if B is nested in A, σ (a)b 2 is the variance of β (i)j. σ (ab)e 2 Residual:

31 30 Model: brσ a 2 + rσ ab 2 + σ (ab)e 2 Factor A: arσ b 2 + rσ ab 2 + σ (ab)e 2 Factor B: rσ ab 2 + σ (ab)e 2 Factor AB: (3) For the coefficient of each variance component, use all letters not in the subscripts of the variance component σ (ab)e 2 Residual:

32 31 Model: brσ a 2 + rσ ab 2 + σ (ab)e 2 arσ b 2 + rσ ab 2 + σ (ab)e 2 rσ ab 2 + σ (ab)e 2 Factor A: Factor B: Factor AB: (4) For each variance component, look at any subscripts outside parentheses that are not in the effect name; if any of these letters corresponds to a fixed effect, omit that variance component σ (ab)e 2 Residual:

33 32 1 2 1 2 1 2 1 2 1 2 1 2 1 2 3 1 2 3 A B C D Two-way anova (A and B fixed) Factor A (drug) Factor B (patient) Replicate Model: SourcedfMSE[MS]F A B AB Error a-1 b-1 (a-1)(b-1) ab(r-1) MS a MS b MS ab MS e brσ a 2 +r σ ab 2 + σ 2 arσ b 2 + r σ ab 2 + σ 2 r σ ab 2 + σ 2 σ 2 MS a /MS e MS b /MS e MS ab /MS e

34 33 1 2 1 2 1 2 1 2 1 2 1 2 1 2 3 1 2 3 A B C D Two-way anova (A fixed, B random) Factor A (drug) Factor B (patient) Replicate Model: SourcedfMSE[MS]F A B AB Error a-1 b-1 (a-1)(b-1) ab(r-1) MS a MS b MS ab MS e brσ a 2 +r σ ab 2 + σ 2 arσ b 2 + r σ ab 2 + σ 2 r σ ab 2 + σ 2 σ 2 MS a /MS ab MS b /MS e MS ab /MS e β j is ND(0, σ b 2 ) (αβ) ij is ND(0; σ ab 2 (1-1/a)) NB!

35 34 1 2 1 2 1 2 1 2 1 2 1 2 1 2 3 1 2 3 A B C D Two-way anova (A and B random) Factor A: Factor B: Replicate Model: SourcedfMSE[MS]F A B AB Error a-1 b-1 (a-1)(b-1) ab(r-1) MS a MS b MS ab MS e brσ a 2 +r σ ab 2 + σ 2 arσ b 2 + r σ ab 2 + σ 2 r σ ab 2 + σ 2 σ 2 MS a /MS ab MS b /MS ab MS ab /MS e β i is ND(0, σ b 2 ) (αβ) ij is ND(0; σ ab 2 ) α i is ND(0, σ a 2 )

36 35 1 2 1 2 1 2 1 2 1 2 1 2 A B C D Nested anova (A fixed, B random) Factor A (drug) Factor B (patient) Replicate Model: SourcedfMSE[MS]F A B(A) Error a-1 a(b-1) ab(r-1) MS a MS (a)b MS e brσ a 2 +r σ (a)b 2 + σ 2 rσ (a)b 2 + σ 2 σ 2 MS a /MS (a)b MS (a)b /MS e MS e β (i)j is ND(0, σ (a)b 2 ) 1 2 3 1 2 3

37 36 1 2 1 2 1 2 1 2 1 2 1 2 A B C D Nested anova (A and B random) Factor A (doctor) Factor B (patient) Replicate Model: SourcedfMSE[MS]F A B(A) Error a-1 a(b-1) ab(r-1) MS a MS (a)b MS e brσ a 2 +r σ (a)b 2 + σ 2 rσ (a)b 2 + σ 2 σ 2 MS a /MS (a)b MS (a)b /MS e MS e β (i)j is ND(0, σ (a)b 2 ) α i is ND(0, σ a 2 ) 1 2 3 1 2 3

38 37 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 ) 1 2 1 2 1 2 1 1 2 3 1 2 1 2 1 2 2 1 2 3 1 2 1 2 1 2 1 1 2 3 1 2 1 2 1 2 2 1 2 3 1 2 1 2 1 2 1 1 2 3 1 2 1 2 1 2 2 1 2 3 Treatment (a = 3) γ (ij)k is ND(0, σ (ab)c 2 )

39 38 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 →

40 39 How do it with SAS

41 40 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 ;

42 41 General Linear Models Procedure Dependent Variable: NITRO Source DF Sum of Squares Mean Square F Value Pr > F Model 17 134.04000000 7.88470588 8.00 0.0001 Error 18 17.75000000 0.98611111 Corrected Total 35 151.79000000 R-Square C.V. Root MSE NITRO Mean 0.883062 3.271932 0.99303127 30.35000000 Source DF Type I SS Mean Square F Value Pr > F TREAT 2 71.78000000 35.89000000 36.40 0.0001 TREE(TREAT) 3 36.04666667 12.01555556 12.18 0.0001 LEAF(TREAT*TREE) 12 26.21333333 2.18444444 2.22 0.0618 Source DF Type III SS Mean Square F Value Pr > F TREAT 2 71.78000000 35.89000000 36.40 0.0001 TREE(TREAT) 3 36.04666667 12.01555556 12.18 0.0001 LEAF(TREAT*TREE) 12 26.21333333 2.18444444 2.22 0.0618 NB! These values are based on MS e as the error term, which is wrong!

43 42 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 ;

44 43 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))

45 44 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*/

46 45 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 2 71.78000000 35.89000000 2.99 0.1933 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) 3 36.04666667 12.01555556 5.50 0.0130

47 46 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;

48 47 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= 12.01556 Critical Value of Studentized Range= 5.910 Minimum Significant Difference= 5.9134 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% -3.663 2.250 8.163 20% - Control -2.513 3.400 9.313 40% - 20% -8.163 -2.250 3.663 40% - Control -4.763 1.150 7.063 Control - 20% -9.313 -3.400 2.513 Control - 40% -7.063 -1.150 4.763

49 48 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= 12.01556 Critical Value of Dunnett's T= 3.866 Minimum Significant Difference= 5.4714 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 -2.071 3.400 8.871 40% - Control -4.321 1.150 6.621

50 49 PROC NESTED; CLASS treat tree leaf; VAR Nitro; RUN;

51 50 Coefficients of Expected Mean Squares Source TREAT TREE LEAF ERROR TREAT 12 6 2 1 TREE 0 6 2 1 LEAF 0 0 2 1 ERROR 0 0 0 1 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

52 51 Nested Random Effects Analysis of Variance for Variable NITRO Degrees Variance of Sum of Error Source Freedom Squares F Value Pr > F Term TOTAL 35 151.790000 TREAT 2 71.780000 2.987 0.1933 TREE TREE 3 36.046667 5.501 0.0130 LEAF LEAF 12 26.213333 2.215 0.0618 ERROR ERROR 18 17.750000 Variance Variance Percent Source Mean Square Component of Total TOTAL 4.336857 5.213333 100.0000 TREAT 35.890000 1.989537 38.1625 TREE 12.015556 1.638519 31.4294 LEAF 2.184444 0.599167 11.4930 ERROR 0.986111 0.986111 18.9152 Mean 30.35000000 Standard error of mean 0.99847105

53 52 The problem of pseudoreplication

54 53 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 3 1 2 3 1 2 3 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!

55 54 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3123123 ABC 1 2 1 2 3 4 5 6 A 1 2 3 4 5 6 1 2 3 4 5 6 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

56 55 40% 20% 0% Four level nested anova Tree (b = 2 ) Replicate (r = 2) Leaf (c = 3 ) 1 2 1 2 1 2 1 1 2 3 1 2 1 2 1 2 2 1 2 3 1 2 1 2 1 2 1 1 2 3 1 2 1 2 1 2 2 1 2 3 1 2 1 2 1 2 1 1 2 3 1 2 1 2 1 2 2 1 2 3 Treatment (a = 3) Trees are the experimental units (2 replicates/treatment) Pseudoreplicates

57 56 Split-plot designs Three types of fertilizers Two types of soil treatment Interactions between fertilizers and soil treatment

58 57 A1A1 A2A2 Block 3 A2A2 A1A1 Block 1 A2A2 A1A1 Block 4 A1A1 A2A2 Block 2 2 whole-plots within each block Soil treatments

59 58 A1A1 A2A2 Block 3 A2A2 A1A1 Block 1 A2A2 A1A1 Block 4 A1A1 A2A2 Block 2 Fertilizer treatments 3 sub- plots within each whole-plot

60 59 Analysis of whole-plots FactordfMSE[MS]F Soil treatment (A) Block (B) Soil*Block (AB) Error a-1 = 1 b-1 =3 (a-1)(b-1) = 3 0 MS a MS b MS ab bσ a 2 +σ ab 2 aσ b 2 + σ ab 2 σ ab 2 MS a /MS ab MS b /MS ab Totalab-1 = 7 β j is ND(0, σ b 2 ) Effect of soil treat Interaction between soil and block Effect of block Interaction term serves as error term

61 60 Analysis of sub-plots FactordfMSE[MS]F Whole plots Fertilizer (C) Soil*Fertilizer (AC) Block*Fert. (BC) Soil*Block*Fert. (ABC) Error ab-1 = 7 c-1 = 2 (a-1)( c-1) = 2 (b-1)(c-1) = 6 (a-1)(b-1)(c-1) = 6 0 MS c MS ac MS bc MS abc abσ c 2 +σ abc 2 bσ ac 2 + σ abc 2 aσ bc 2 + σ abc 2 σ abc 2 MS c /MS abc MS ac /MS abc MS bc /MS abc Totalabc-1 = 23 (βγ) jk is ND(0, σ bc 2 (1-1/c)) Effect of fertilizer Interaction between soil treatment and fertilizer Interaction between block and fertilizer

62 61 Analysis of sub-plots FactordfMSE[MS]F Whole plots Fertilizer (C) Soil*Fertilizer (AC) Block*Fert. (BC) Soil*Block*Fert. (ABC) Error ab-1 = 7 c-1 =2 (a-1)( c-1) =2 (b-1)(c-1) = 6 (a-1)(b-1)(c-1) = 6 0 MS c MS ac MS bc MS abc abσ c 2 +σ 2 bσ ac 2 + σ 2 bσ bc 2 + σ 2 σ 2 MS c /MS e MS ac /MS e MS bc /MS e Totalabc-1 = 23 (βγ) jk is ND(0, σ bc 2 (1-1/c))

63 62 Analysis of sub-plots FactordfMSE[MS]F Whole plots Fertilizer (C) Soil*Fertilizer (AC) Block*Fert. (BC) Soil*Block*Fert. (ABC) Error ab-1 = 7 c-1 =2 (a-1)( c-1) =2 (b-1)(c-1) = 6 (a-1)(b-1)(c-1) = 6 0 MS c MS ac MS bc MS abc abσ c 2 +σ 2 bσ ac 2 + σ 2 σ 2 MS c /MS e MS ac /MS e Totalabc-1 = 23 (βγ) jk is ND(0, σ bc 2 (1-1/c))

64 63 How do it with SAS

65 64 DATA SplitPlt; /* Example 6-8 in the lecture notes */ /* block = block effect (random factor) */ /* soil = effect of soil treatment (whole-plot effect) */ /* fert = effect of fertilizer (subplot effect) */ /* yield = dependent variable */ INFILE 'h:\lin-mod\eks6-8.prn'; INPUT soil $ block $ fert $ yield; PROC GLM; TITLE 'Split plot - full model'; CLASS block soil fert; MODEL yield= block soil block*soil fert soil*fert block*fert ; RANDOM block; /* declare block as a random effect */ TEST h = soil e = block*soil; /* tests effect of wholeplot */ TEST h = block e = block*soil; /* tests effect of blocks */ RUN;

66 65 Split plot - full model The GLM Procedure Dependent Variable: yield Sum of Source DF Squares Mean Square F Value Pr > F Model 17 32796.58333 1929.21078 3.24 0.0764 Error 6 3575.41667 595.90278 Corrected Total 23 36372.00000 R-Square Coeff Var Root MSE yield Mean 0.901699 15.02223 24.41112 162.5000 Source DF Type III SS Mean Square F Value Pr > F block 3 588.33333 196.11111 0.33 0.8050 soil 1 7848.16667 7848.16667 13.17 0.0110 block*soil 3 3740.83333 1246.94444 2.09 0.2027 fert 2 10950.75000 5475.37500 9.19 0.0149 soil*fert 2 462.58333 231.29167 0.39 0.6942 block*fert 6 9205.91667 1534.31944 2.57 0.1373 Tests of Hypotheses Using the Type III MS for block*soil as an Error Term Source DF Type III SS Mean Square F Value Pr > F soil 1 7848.166667 7848.166667 6.29 0.0870 block 3 588.333333 196.111111 0.16 0.9185 Sub-plot effects NB! These P-values cannot be used! Instead use these whole-plot results Whole-plot effects

67 66 PROC GLM; TITLE 'Split plot - reduced model block*fert omitted'; CLASS block soil fert; MODEL yield= block soil block*soil fert soil*fert; RANDOM block; TEST h = soil e = block*soil; /* tests effect of wholeplot */ TEST h = block e = block*soil; /* tests effect of blocks */ RUN;

68 67 Split plot - reduced model block*fert omitted The GLM Procedure Dependent Variable: yield Sum of Source DF Squares Mean Square F Value Pr > F Model 11 23590.66667 2144.60606 2.01 0.1224 Error 12 12781.33333 1065.11111 Corrected Total 23 36372.00000 R-Square Coeff Var Root MSE yield Mean 0.648594 20.08372 32.63604 162.5000 Source DF Type III SS Mean Square F Value Pr > F block 3 588.33333 196.11111 0.18 0.9051 soil 1 7848.16667 7848.16667 7.37 0.0188 block*soil 3 3740.83333 1246.94444 1.17 0.3615 fert 2 10950.75000 5475.37500 5.14 0.0244 soil*fert 2 462.58333 231.29167 0.22 0.8079

69 68 PROC GLM; TITLE 'Split plot - reduced model block*fert and soil*fert omitted'; CLASS block soil fert; MODEL yield= block soil block*soil fert; RANDOM block; TEST h = soil e = block*soil; /* tests effect of wholeplot */ TEST h = block e = block*soil; /* tests effect of blocks */ MEANS soil /TUKEY e= block*soil CLM CLDIFF; /* confidence limits for wholeplot effects */ MEANS fert /TUKEY CLM CLDIFF; /* confidence limits for subplot effects */ RUN;

70 69 Split plot - reduced model block*fert and soil*fert omitted 97 Dependent Variable: yield Sum of Source DF Squares Mean Square F Value Pr > F Model 9 23128.08333 2569.78704 2.72 0.0457 Error 14 13243.91667 945.99405 Corrected Total 23 36372.00000 R-Square Coeff Var Root MSE yield Mean 0.635876 18.92739 30.75702 162.5000 Source DF Type III SS Mean Square F Value Pr > F block 3 588.33333 196.11111 0.21 0.8896 soil 1 7848.16667 7848.16667 8.30 0.0121 block*soil 3 3740.83333 1246.94444 1.32 0.3079 fert 2 10950.75000 5475.37500 5.79 0.0147

71 70 The GLM Procedure Tukey's Studentized Range (HSD) Test for yield NOTE: This test controls the Type I experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 3 Error Mean Square 1246.944 Critical Value of Studentized Range 4.50067 Minimum Significant Difference 45.879 Comparisons significant at the 0.05 level are indicated by ***. Difference Simultaneous soil Between 95% Confidence Comparison Means Limits 2 - 1 36.17 -9.71 82.05 1 - 2 -36.17 -82.05 9.71

72 71 The GLM Procedure Tukey's Studentized Range (HSD) Test for yield NOTE: This test controls the Type I experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 14 Error Mean Square 945.994 Critical Value of Studentized Range 3.70139 Minimum Significant Difference 40.25 Comparisons significant at the 0.05 level are indicated by ***. Difference Simultaneous fert Between 95% Confidence Comparison Means Limits 3 - 2 15.38 -24.87 55.62 3 - 1 51.00 10.75 91.25 *** 2 - 3 -15.38 -55.62 24.87 2 - 1 35.63 -4.62 75.87 1 - 3 -51.00 -91.25 -10.75 *** 1 - 2 -35.63 -75.87 4.62


Download ppt "1 Experimental design and statistical analyses of data Lesson 5: Mixed models Nested anovas Split-plot designs."

Similar presentations


Ads by Google