Topic 6. Two-way designs: Randomized Complete Block Design [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and section 15.8]

Similar documents
Lecture 7 Randomized Complete Block Design (RCBD) [ST&D sections (except 9.6) and section 15.8]

2. Treatments are randomly assigned to EUs such that each treatment occurs equally often in the experiment. (1 randomization per experiment)

PLS205 Lab 2 January 15, Laboratory Topic 3

PLS205 Lab 6 February 13, Laboratory Topic 9

PLS205!! Lab 9!! March 6, Topic 13: Covariance Analysis

PLS205 Winter Homework Topic 8

PLS205 KEY Winter Homework Topic 3. The following represents one way to program SAS for this question:

Topic 13. Analysis of Covariance (ANCOVA) [ST&D chapter 17] 13.1 Introduction Review of regression concepts

Topic 9: Factorial treatment structures. Introduction. Terminology. Example of a 2x2 factorial

IX. Complete Block Designs (CBD s)

COMPLETELY RANDOM DESIGN (CRD) -Design can be used when experimental units are essentially homogeneous.

Allow the investigation of the effects of a number of variables on some response

Topic 13. Analysis of Covariance (ANCOVA) - Part II [ST&D Ch. 17]

Increasing precision by partitioning the error sum of squares: Blocking: SSE (CRD) à SSB + SSE (RCBD) Contrasts: SST à (t 1) orthogonal contrasts

Topic 8. Data Transformations [ST&D section 9.16]

Chap The McGraw-Hill Companies, Inc. All rights reserved.

The legacy of Sir Ronald A. Fisher. Fisher s three fundamental principles: local control, replication, and randomization.

Topic 12. The Split-plot Design and its Relatives (continued) Repeated Measures

DESAIN EKSPERIMEN BLOCKING FACTORS. Semester Genap 2017/2018 Jurusan Teknik Industri Universitas Brawijaya

The ε ij (i.e. the errors or residuals) are normally distributed. This assumption has the least influence on the F test.

Laboratory Topics 4 & 5

STAT 115:Experimental Designs

Lecture 15 Topic 11: Unbalanced Designs (missing data)

Lecture 4 Topic 3: General linear models (GLMs), the fundamentals of the analysis of variance (ANOVA), and completely randomized designs (CRDs)

Topic 7: Incomplete, double-blocked designs: Latin Squares [ST&D sections ]

CHAPTER 4 Analysis of Variance. One-way ANOVA Two-way ANOVA i) Two way ANOVA without replication ii) Two way ANOVA with replication

Outline Topic 21 - Two Factor ANOVA

Assignment 6 Answer Keys

SAS Commands. General Plan. Output. Construct scatterplot / interaction plot. Run full model

Single Factor Experiments

Topic 17 - Single Factor Analysis of Variance. Outline. One-way ANOVA. The Data / Notation. One way ANOVA Cell means model Factor effects model

Lecture 3: Inference in SLR

Statistics For Economics & Business

STAT Chapter 10: Analysis of Variance

Topic 20: Single Factor Analysis of Variance

Inference for Regression Simple Linear Regression

ANOVA: Comparing More Than Two Means

Lecture 7: Latin Square and Related Design

Two-factor studies. STAT 525 Chapter 19 and 20. Professor Olga Vitek

5.3 Three-Stage Nested Design Example

Lecture 14 Topic 10: ANOVA models for random and mixed effects. Fixed and Random Models in One-way Classification Experiments

Topic 12. The Split-plot Design and its Relatives (Part II) Repeated Measures [ST&D Ch. 16] 12.9 Repeated measures analysis

Introduction to Design and Analysis of Experiments with the SAS System (Stat 7010 Lecture Notes)

We need to define some concepts that are used in experiments.

4.1. Introduction: Comparing Means

Chapter 4: Randomized Blocks and Latin Squares

Assessing Model Adequacy

df=degrees of freedom = n - 1

Lecture 4. Random Effects in Completely Randomized Design

Lecture 3. Experiments with a Single Factor: ANOVA Montgomery 3-1 through 3-3

Summary of Chapter 7 (Sections ) and Chapter 8 (Section 8.1)

ANALYSIS OF VARIANCE OF BALANCED DAIRY SCIENCE DATA USING SAS

Example: Four levels of herbicide strength in an experiment on dry weight of treated plants.

Estimating σ 2. We can do simple prediction of Y and estimation of the mean of Y at any value of X.

RCB - Example. STA305 week 10 1

Analysis of Variance

Comparison of a Population Means

Linear Combinations of Group Means

BIOL 933!! Lab 10!! Fall Topic 13: Covariance Analysis

Introduction. Chapter 8

Week 7.1--IES 612-STA STA doc

Analysis of Variance. ภาว น ศ ร ประภาน ก ล คณะเศรษฐศาสตร มหาว ทยาล ยธรรมศาสตร

Econ 3790: Business and Economic Statistics. Instructor: Yogesh Uppal

Lecture 3. Experiments with a Single Factor: ANOVA Montgomery 3.1 through 3.3

1 The Randomized Block Design

Y it = µ + τ i + ε it ; ε it ~ N(0, σ 2 ) (1)

Chapter 11 - Lecture 1 Single Factor ANOVA

Analysis of variance

Chapter 20 : Two factor studies one case per treatment Chapter 21: Randomized complete block designs

Mean Comparisons PLANNED F TESTS

N J SS W /df W N - 1

DESAIN EKSPERIMEN Analysis of Variances (ANOVA) Semester Genap 2017/2018 Jurusan Teknik Industri Universitas Brawijaya

ANOVA (Analysis of Variance) output RLS 11/20/2016

Ch 2: Simple Linear Regression

PLSC PRACTICE TEST ONE

Unit 8: 2 k Factorial Designs, Single or Unequal Replications in Factorial Designs, and Incomplete Block Designs

Inferences for Regression

Lecture 5: Comparing Treatment Means Montgomery: Section 3-5

BALANCED INCOMPLETE BLOCK DESIGNS

Lec 1: An Introduction to ANOVA

V. Experiments With Two Crossed Treatment Factors

Analysis of Variance and Design of Experiments-I

Chapter 10. Design of Experiments and Analysis of Variance

Unit 12: Analysis of Single Factor Experiments

K. Model Diagnostics. residuals ˆɛ ij = Y ij ˆµ i N = Y ij Ȳ i semi-studentized residuals ω ij = ˆɛ ij. studentized deleted residuals ɛ ij =

Analysis of Covariance

The One-Way Repeated-Measures ANOVA. (For Within-Subjects Designs)

Topic 28: Unequal Replication in Two-Way ANOVA

Factorial designs. Experiments

Multiple Regression. Inference for Multiple Regression and A Case Study. IPS Chapters 11.1 and W.H. Freeman and Company

Topic 4: Orthogonal Contrasts

Two-Way Analysis of Variance - no interaction

Lecture 11: Simple Linear Regression

Unit 6: Orthogonal Designs Theory, Randomized Complete Block Designs, and Latin Squares

Analysis of variance and regression. April 17, Contents Comparison of several groups One-way ANOVA. Two-way ANOVA Interaction Model checking

Chapter 4: Regression Models

Multiple comparisons The problem with the one-pair-at-a-time approach is its error rate.

T-test: means of Spock's judge versus all other judges 1 12:10 Wednesday, January 5, judge1 N Mean Std Dev Std Err Minimum Maximum

The Random Effects Model Introduction

Formal Statement of Simple Linear Regression Model

Transcription:

Topic 6. Two-way designs: Randomized Complete Block Design [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and section 15.8] The completely randomized design Treatments are randomly assigned to e.u. such that each treatment occurs equally often in the experiment. 1 randomization It is assumed that the experimental units are uniform. It is always advocated to include as much of the native variability of the experiment as possible within each experimental unit Since experimental units are more variable, experimental error (MSE) is large, F (MST/MSE) is small, and the experiment is not very sensitive. 6.. Randomized complete block design (RCBD) The population of experimental units is divided into a number of relatively homogeneous subpopulations or blocks. Treatments are randomly assigned to experimental units such that each treatment occurs equally often in each block. 1 randomization per block The variation among blocks can be partitioned out, usually reducing the experimental error (MSE). Blocks usually represent levels of naturally-occurring differences or sources of variation unrelated to the treatments. The characterization of these differences is not of interest to the researcher 6... Example: Three cultivars with 4 replications. N level varies from north to south. In a CRD error terms will tend to be negative at one end of the field and positive at the other. Block 1 3 1 1 (B) (A) 3 (C) 4 5 6 7 8 9 N 3 4 (A) 5 (B) 6 (C) 7 (A) 8 (C) 9 (B) N 10 11 1 4 10 (A) 11 (C) 1 (B) The field can be divided into four blocks of three plots each, and the soil in each of these blocks will be uniform. RCBD: INDEPENDENT RANDOMIZATIONS IN EACH BLOCK! 1

6.. 3. Statistical model The new model is Yij = µ+ τi + βj + εij. The sum of squares equation becomes: t r t r t r.. ( Yij Y i. Y. j + Y.. ) i= 1 j= 1 i= 1 j= 1 i= 1 j= 1 ( Yij Y ) = r ( Y i. Y.. ) + t ( Y. j Y.. ) + or, TSS = SST + SSB + SSE. Variance of means of n observations is σ /n multiplication by r and t in the SSB and SST result in all MS being estimates of the same σ when there are no block or treatment effects. Partitioning of variance: is possible because the sums of squares of blocks and treatments are orthogonal (each block has all treatments). 6.. 4. ANOVA ANOVA table for the RCBD with 1 replication per block-treatment combination Source Df SS MS F Blocks r 1 SSB SSB/(r-1) Treatments t 1 SST SST/(t-1) MST/MSE Error (t-1)(r-1) SS-SST-SSB SSE/(r-1)(t-1) Total rt 1 SS ANOVA table for the CRD Source Df SS MS F Treatments t 1 SST SST/(t-1) MST/MSE Error t(r - 1) SS - SST SSE/t(r-1) Total rt 1 SS The RCBD design has r - 1 fewer degrees of freedom than the CRD. If blocks were no different, the MSE for the CRD would be smaller than the MSE for the RCBD and the CRD would be more powerful. If there was a substantial difference between blocks, the MSE for the RCBD would be smaller than the MSE for the CRD and the RCBD would be more powerful. Obviously one should only use the RCBD when it is appropriate, but how can this be determined? The concept of efficiency, discussed in section 6. 3., answers this. If >1 rep. you can add Block*Trt. to explore its significance

Example: An experiment was conducted to investigate the effect of estrogen on weight gain in sheep. The treatments are combinations of sex of sheep (M, F) and level of estrogen (Est 0, Est 3 ). The sheep are blocked by ranch, with one replication of each treatment level at each ranch. Ranch Trtmt 1 3 4 M Est 0 M Est 3 F Est 0 F Est 3 RCBD. Effect of estrogen on weight gains. Blocks are 4 different ranches. Block Treatment Treatment I II III IV Total Mean F-S0 47 5 6 51 1 53 M-S0 50 54 67 57 8 57 F-S3 57 53 69 57 36 59 M-S3 54 65 74 59 5 63 Block Mean 5 56 68 56 58 Table 6. RCBD ANOVA Source of Variation df SS MS F Totals 15 854 Blocks 3 576 19.00 4.69** Treatments 3 08 69.33 8.91** Error 9 70 7.78 Table 6.3 CRD ANOVA Source of Variation df SS MS F Totals 15 854 Treatments 3 08 69.33 1.9 NS Error 1 646 53.83 Differences among blocks do not result from treatments but from other differences associated with the blocks. This component of the total sum of squares can be removed and the experimental error reduced accordingly. Compare the SS error in Tables 6. and 6.3 3

6. 3. Relative efficiency: When to block? [ST&D p. 1, Topic 1, 1.4.4.6] F = MST MSE MSE = SSE F crit = Fα, df df trt, df e e Blocking reduces SSE, which reduces MSE. Blocking reduces df e, which increases MSE and increases F crit. The concept of relative efficiency formalizes the comparison between two experimental methods by quantifying this balance between loss of degrees of freedom and reduction in experimental error. The information per replication in a given design is: I 1 df MSE + 1 1 df MSE 3 = (when MSE df<0 a correction factor is used) σ + MSE RE 1: = I I 1 df df df df MSE1 MSE1 MSE MSE + 1 1 3 + MSE + 1 1 3 + MSE 1 ( df = ( df MSE1 MSE + 1)( df + 1)( df MSE MSE1 + 3) MSE + 3) MSE 1 If RE is >1, design 1 provides more information and is more efficient. The main complication is how to estimate MSE for the alternative design. If an experiment was conducted as an RCBD, MSE CRD can be estimated by the following formula (ST&D ): MSE ˆ CRD df B MSB + ( df df + df RCBD B T T + df + df e e ) MSE RCBD weighted average MSB and MSE To obtain this formula the TSS of the designs are assumed equal, and then the MS are replaced by the variance components of the expected MS (next page) Example: Sheep experiment: MSE RCBD = 7.78, and MSB RCBD = 19.0, so MSE CRD 3*19.0 + (3 + 9)7.78 3 + 3 + 9 = 44.6 RE RCBD to CRD = ( f ( f crd + 1)( f + 1)( f rcbd crd RCBD + 3) MSE + 3) MSE crd RCBD = (9 + 1)(1 + 3)44.6 (1 + 1)(9 + 3)7.78 = 5.51 5.51 replications of the CRD produce the same amount of information as one replication of the RCBD. 4

Derivation of the expected MSE CRD To estimate MSE CRD from the MS of an RCBD: Assume that the total SS of the two designs is the same. Rewrite the total SS as the addition of its different components Rewrite each total SS as the product between df*ms Replace each MS by the variance components of the EXPECTED MS Rewrite this formula in terms of the MS. Since o σ (RB)= MS E(RB) and σ B= (MS B - MS E(RB) )/a we obtain ft+fe fb fb+ft+fe 5

Power comparison between CRD and RCBD designs 1. Not significant differences among blocks. MSE RCBD =MSE CRD distribution of the difference between two means (RCBD and CRD). α/ Rejection threshold CRD 0 df MSE: CRD > RCBD Critical F: RCBD > CRD Rejection threshold RCBD When there are no significant differences among blocks power CRD > power RCBD Power 1 β β Significant differences among blocks. > 0 MSE RCBD <MSE CRD distribution of the difference between two means (RCBD). distribution of the difference between two means (CRD) α/ 0 When the reduction in MSE RCBD offsets the lost degrees of freedom power RCBD > power CRD Power 1 β β > 0 6

6.4. Assumptions of the model Model for the RCBD with a single replication per block-treatment combination: Y ij = µ + τ i + β j + ε ij 1. The residuals (ε ij ) are independent, homogeneous, and normally distributed.. The variance within each treatment levels is homogeneous across all treatment levels. 3. The main effects are additive. Recall that experimental error is defined as the variation among experimental units that are treated alike. Ranch Trtmt 1 3 4 M Est 0 M Est 3 F Est 0 F Est 3 There is an expected value for each sheep, given by: Expected Y ij = µ + τ i + β j Observed Y ij = µ + τ i + β j + ε ij With only one replication per cell, the interaction τ i *β j cannot be included in the model (there will be 0 df for error). Therefore, the residuals are the combined effects of experimental error and treatment*block interactions: ε ij = τ i *β j + error ij So when we use ε ij as estimate of the true experimental error, we are assuming that τ i *β j = 0. This assumption of no interaction is referred to as the assumption of additivity of the main effects. If this assumption is violated, all F-tests will be inefficient and possibly misleading, particularly if the interaction effect is very large. 7

Example: Consider the hypothetical effects of two factors (A, B) on some response variable (assume µ=0): Purely additive Factor A Factor B τ 1 = 1 τ = τ3 = 3 β1 = 1 3 4 β = 5 6 7 8 Purely multiplicative Factor A Factor B τ 1 = 1 τ = τ3 = 3 β1 = 1 1 3 β = 5 5 10 15 4 8 1 If multiplicative data are analyzed by a ANOVA, the interaction SS will be large due to the non-additivity of the treatment effects. In the case of multiplicative effects, there is a simple remedy. Simply transform the variable using logs to restore additivity: Restoring additivity (log of multiplicative data) Factor A Factor B τ 1 = 0.00 τ = 0.30 τ3 = 0.48 β1 = 0.00 0.00 0.30 0.48 β = 0.70 0.70 1.00 1.18 0.7 0.7 0.7 By transforming the variable into logs the additivity of the data is restored. This is a good illustration of how transformations of scale can be used to meet the assumptions of analysis of variance. 8

6. 4. 1. Tukey s test for non-additivity [ST&D 395] Under our linear model, each observation is characterized as: yij = µ + β + τ + ε i j ij The predicted value of each individual is given by: predij = µ + β i + τ j So, if we had no error in our experiment (i.e. if ε ij = 0), the observed data would exactly match its predicted values and a correlation plot of the two would yield a perfect line with slope = 1: Observed 0 18 16 14 1 10 Observed vs. Predicted Values (RCBD, no error) 10 1 14 16 18 0 Predicted Observed vs. Predicted (RCBD, with error) Now let's introduce some error: still linear! 0 18 Observed.. 16 14 1 10 10 1 14 16 18 0 Predicted But what happens when you have an interaction (e.g. Block * Treatment) but lack the degrees of freedom necessary to include it in the linear model? ε ε + B*T Interaction Effects ij = RANDOMij Observed.. 0 18 16 14 1 Observed vs. Predicted (RCBD, with error and B*T) 10 10 1 14 16 18 0 Predicted SO, if the observed and predicted values obey a linear relationship, then the non-random Interaction Effects buried in the error term are sufficiently small to uphold our assumption of additivity of main effects. 9

This test is easily implemented using SAS: Data Lambs; Input Sex_Est $ @@; Do Ranch = 1 to 4; Input Gain @@; Output; End; Cards; F0 47 5 6 51 M0 50 54 67 57 F3 57 53 69 57 M3 54 65 74 59 ; Proc GLM; Class Sex_Est Ranch; Model Gain = Ranch Sex_Est; Output out = LambsPR p = Pred r = Res; Proc GLM; * This is the Tukey 1 df test; Class Sex_Est Ranch; Model Gain = Ranch Sex_Est Pred*Pred; Run;Quit; 1.- The second Proc GLM adds an additional variable that is the square of the predicted values: Pred*Pred, which is used in the non-additivity test..- If this quadratic component is significant the relationship is not linear! 3.- Pred*Pred is not in the Class statement, and is last term in the Model. Output from the nd Proc GLM (the Tukey 1 df test): Source DF Type III SS Mean Square F Value Pr > F Ranch 3 0.73506585 0.450195 0.03 0.997 Sex_Est 3 0.980876 0.099364 0.01 0.9981 Pred*Pred 1 3.4188034 3.4188034 0.41 0.5395 NS Since P= 0.5395, NS, we do not reject the null hypothesis of additive effects This test is necessary ONLY when there is one observation per block-treatment combination. If there are two or more replications per block-treatment combination, the block*treatment interaction can be tested directly in an exploratory model: Model Gain = Ranch Sex_Est Ranch*Sex_Est; 10

Example Table 6.5. Yield of penicillin in four treatments A, B, C, D. Blocks are different stocks of a raw material. The numbers below each observation (O) are the predicted (P: Grand Mean + Treatment effect + Block effect) and residual (R) values. Block Stock 1 O: 89 P: 90 R: -1 Stock O: 84 P: 81 R: 3 Stock 3 O: 81 P: 83 R: - Stock 4 O: 87 P: 86 R: 1 Stock 5 O: 79 P: 80 R: -1 Treatment A B C D O: 88 P: 91 R: -3 O: 77 P: 8 R: -5 O: 87 P: 84 R: 3 O: 9 P: 87 R: 5 O: 81 P: 81 R: 0 O: 97 P: 95 R: O: 9 P: 86 R: 6 O: 87 P: 88 R: -1 O: 89 P: 91 R: - O: 80 P: 85 R: -5 O: 94 P: 9 R: O: 79 P: 83 R: -4 O: 85 P: 85 R: 0 O: 84 P: 88 R: -4 O: 88 P: 8 R: 6 Block Mean 9 +6 83-3 85-1 88 8-4 Treat. 84 85 89 86 Mean=86 Treat. - -1 3 0 Block Effect In this example no particular pattern is observed in the residuals. This observation parallels the normal distribution of the residuals, the homogeneous variances of the residuals among treatments and a nonsignificant Tukey s test for non-additivity. 11

The SAS code for such an analysis: Data Penicillin; Do Block = 1 to 4; Do Trtmt = 1 to 4; Input Yield @@; Output; End; End; Cards; 89 88 97 94 84 77 9 79 81 87 87 85 87 9 89 84 79 81 80 88 ; Proc GLM Data = Penicillin; Class Block Trtmt; Model Yield = Block Trtmt; Output out = PenPR p = Pred r = Res; Proc Univariate Data = PenPR normal; * Testing for normality of residuals; Var Res; Proc GLM Data = Penicillin;* Testing for variance homogeneity (1 way ANOVA); Class Trtmt; Model Yield = Trtmt; Means Trtmt / hovtest = Levene; Proc Plot Data = PenPR;* Generating a plot of predicted vs. residual values; Plot Res*Pred = Trtmt; Proc GLM Data = PenPR; * Testing for nonadditivity; Class Block Trtmt; Model Yield = Block Trtmt Pred*Pred; Run;Quit; This dataset meets all assumptions: normality, σ homogeneity, and additivity: Normality Test --Statistic--- -----p Value------ Shapiro-Wilk W 0.967406 Pr < W 0.6994 NS Levene's Test for Homogeneity of Yield Variance ANOVA of Squared Deviations from Group Means Sum of Mean Source DF Squares Square F Value Pr > F Trtmt 3 9. 307.4 0.39 0.760 NS Error 16 1618.8 788.7 Tukey's 1 df test for nonadditivity Source DF Type III SS Mean Square F Value Pr > F Block 3 8.915818 9.43071939 0.8 0.8365 Trtmt 3 8.681454 9.471508 0.8 0.8367 Pred*Pred 1 6.46875000 6.46875000 0.79 0.3901 NS 1

Discrepancies between the tentative model and the data can be detected by studying residuals. These residuals are the quantities remaining after the systematic contributions associated with the assumed model are removed. Sometimes the plot of the residuals versus the predicted values shows a curvilinear relationship. This appearance suggests non-additivity between the block and the treatment effects Other times the plot of the residuals versus the predicted shows a funnel-like appearance. This indicates that the variance increases as the value of the response increases (a situation that is common when the variance is a constant percentage of the mean). Another useful plot to consider is the scatterplot of residuals vs. the sequence in which the data was collected. Such a plot can reveal patterns of systematic variation during the data collection (e.g. increasing variation with time as the operators get tired). 13

EXAMPLE LAMBS NESTED 16 animals, 4 ranches. Randomly assign animals to the four treatments in each ranch and make measurements per animal Animal = pot in our CRD nested example and the two measurements are like the two plants measured in each pot. The Animal is nested within the block*trt combination data lambs; input sex_est $ block animal gain @@; cards; f0 1 1 46 f0 1 51 f0 3 1 61 f0 4 1 50 m0 1 49 m0 53 m0 3 66 m0 4 56 f3 1 3 56 f3 3 5 f3 3 3 68 f3 4 3 56 m3 1 4 53 m3 4 64 m3 3 4 73 m3 4 4 58 Block 1 Block f0 m0 f3 m3 f0 1 1 48 f0 1 53 f0 3 1 6 f0 4 1 5 Block 3 m0 1 51 m0 55 m0 3 68 m0 4 58 f3 1 3 58 f3 3 54 f3 3 3 70 f3 4 3 58 Block 4 m3 1 4 55 m3 4 66 m3 3 4 75 m3 4 4 60 measurements proc glm data=lambs order=data; *Without order=data, SAS reads alphabetically f0 f3 m0 m3; *With order=data, SAS reads f0 m0 f3 m3: Contrast are different!; class block sex_est animal; model gain= block sex_est animal(block*sex_est); random animal(block*sex_est); test h=sex_est e=animal(block*sex_est); contrast 'sex' sex_est 1-1 1-1 / e=animal(block*sex_est); contrast 'estrogen' sex_est 1 1-1 -1 / e=animal(block*sex_est); contrast 'interaction' sex_est 1-1 -1 1 / e=animal(block*sex_est); means sex_est/tukey e=animal(block*sex_est); *Above is Tukey test wih correct error for comparison; *Below is Tukey test wih incorrect error for comparison; means sex_est/tukey; proc varcomp Method= Type1; class block sex_est animal; model gain= block sex_est animal(block*sex_est); run; quit; Remember to average subsamples and test Levene & Tukey non-additivity test 14

Output LAMB NESTED ANOVA Dependent Variable: gain Source DF SS MS F Value Pr > F Model 15 1700.5 113.4 59.47 <.0001 Error 16 30.5 1.9 Corrected Total 31 1731.0 Source DF SS MS F Value Pr > F block 3 113.1 377.4 198.0 <.0001 sex_est 3 46.1 14.0 74.5 <.0001 animal(block*sex_est) 9 14.3 14.8 8.3 0.000 Tests of Hypotheses Using MS for animal(block*sex_est) as Error Term Source DF SS MS F Value Pr > F sex_est 3 46.1 14.0 8.98 0.0045 Contrast DF SS MS F Value Pr > F sex 1 13.0 13.0 8.35 0.0179 estrogen 1 94.0 94.0 18.60 0.000 interaction 1 0.03 0.03 0.00 0.9655 Tukey's Studentized Range (HSD) Test for gain Correct Incorrect Critical Value 4.4 4.0 Minimum Significant Diff. 6..0 Correct Grouping Incorrect Grouping Mean N sex_est A A 63.000 8 m3 B A B 59.000 8 f3 B A C 57.000 8 m0 B D 5.875 8 f0 Variance Components Source Expected Mean Square block Var(Error) + Var(animal(block*sex_est))+ 8 var (block) sex_est Var(Error) + Var(animal(block*sex_est))+ 8 var (sex_est) animal(block*sex_est) Var(Error) + Var(animal(block*sex_est) Error Var(Error) Variance Component Estimate % Var(block) 45.3 64.7 Var(sex_est) 15.8.6 Var animal(block*sex_est) 7.0 10.0 Var(Error) 1.9.7 The calculation of the variance comp. is the objective of the nested design This % contribution can be used to optimize the allocation of resources. 15

EXAMPLE LAMBS RCBD with reps per cell 3 animals distributed in 4 blocks. We randomly assign 8 animals to the four treatments in each block. When we have more than one rep per block/treatment combination we include the interaction Block*Treatment in an exploratory model. If the interaction is significant, transform the data and then exclude from the model. Do not perform a Tukey's test for non-additivity. data lambs; input sex_est $ block gain @@; cards; f0 1 46 f0 51 f0 3 61 f0 4 50 m0 1 49 m0 53 m0 3 66 m0 4 56 f3 1 56 f3 5 f3 3 68 f3 4 56 m3 1 53 m3 64 m3 3 73 m3 4 58 f0 1 48 f0 53 f0 3 6 f0 4 5 m0 1 51 m0 55 m0 3 68 m0 4 58 f3 1 58 f3 54 f3 3 70 f3 4 58 m3 1 55 m3 66 m3 3 75 m3 4 60 Block 1 Block Block 3 Block 4 f0 m0 f3 proc glm data=lambs order=data; *Without order=data, SAS reads alphabetically f0 f3 m0 m3; class block sex_est; model gain= block sex_est block*sex_est; * Exploratory model output out=check p= pred r= resi; proc glm data=lambs order=data; class block sex_est; model gain= block sex_est; *final model output out=check p= pred r= resi; contrast 'sex' sex_est 1-1 1-1; contrast 'estrogen' sex_est 1 1-1 -1; contrast 'interaction' sex_est 1-1 -1 1; *The Contrasts in this proc glm will use the error term of the complete model; means sex_est/tukey; *Example of mean comparisons in an RCBD; proc univariate data=check normal; var resi; *In this artificial data the residuals are not Normal, is just presented as an example of the programming; proc glm data=lambs; *Homogeneity of σ with LEVENE should be tested in one-way ANOVA; class sex_est; model gain= sex_est; means sex_est/ HOVTEST = LEVENE; run; quit; σ ε 16

Output LAMB Reps ANOVA Dependent Variable: gain Source DF SS MS F Value Pr > F Model 15 1700.5 113.4 59.47 <.0001 Error 16 30.5 1.9 Corrected Total 31 1731.0 Source DF SS MS F Value Pr > F block 3 113.1 377.4 198.0 <.0001 sex_est 3 46.1 14.0 74.5 <.0001 block*sex_est 9 14.3 15.8 8.3 0.000 Contrast DF SS MS F Value Pr > F sex 1 13.0 13.0 69.6 <.0001 estrogen 1 94.0 94.0 154.5 <.0001 interaction 1 0.0 0.0 0.0 0.8997 Interaction is not significant so exclude from the model and repeat ANOVA Tukey's Studentized Range (HSD) Test for gain Minimum Significant Diff. 1.97 Grouping Mean N sex_est A 63.000 8 m3 B 59.000 8 f3 C 57.000 8 m0 D 5.875 8 f0 Tests for Normality Test --Statistic--- -----p Value------ Shapiro-Wilk W 0.66784 Pr < W <0.0001 Not Normal residues. A transformation is required. Levene's Test for Homogeneity of Variance ANOVA of Squared Deviations from Group Means Sum of Mean Source DF Squares Square F Value Pr > F sex_est 3 3181.5 1060.5 0.54 0.6567 Error 8 54660.5 195. Homogeneity of variance not rejected 17

RCBD 1 rep/cell RCBD 1 rep/cell with subsamples T1 T T1 T B1 B1 B Class Block Trtmt; Model Y = Block Trtmt; Tukey Test Required B Class Block Trtmt Pot; Model Y = Block Trtmt Pot(Block*Trtmt); Random Pot(Block*Trtmt); Test h = Trtmt e = Pot(Block*Trtmt); Tukey Test Required RCBD >1 rep/cell RCBD >1 rep/cell with subsamples T1 T T1 T B1 B1 B B Exploratory model: Class Block Trtmt; Model Y = Block Trtmt Block*Trtmt; Tukey Test not Required ANOVA: Class Block Trtmt; Model Y = Block Trtmt; Exploratory model: Class Bl Trt Pot; Model Y = Bl Trt Bl*Trt Pot(Bl*Trt); Random Pot(Bl*Trt); Test h = Bl*Trt e = Pot(Bl*Trt); Tukey Test not Required ANOVA: Class Bl Trt Pot; Model Y = Bl Trt Pot(Bl*Trt); Random Pot(Bl*Trt); Test h = Trt e = Pot(Bl*Trt); 18