Latin Square Designs (§15.4) • Lecture Objective – Introduce basic experimental designs that account for two orthogonal sources of extraneous variation. • Terminology – Square design – Orthogonal blocks – Randomizations Latin Square -1 Examples • A researcher wishes to perform a yield experiment under field conditions, but she/he knows or suspects that there are two fertility trends running perpendicular to each other across the study plots. • An animal scientists wishes to study weight gain in piglets but knows that both litter membership and initial weights significantly affect the response. • In a greenhouse, researchers know that there is variation in response due to both light differences across the building and temperature differences along the building. • An agricultural engineer wishing to test the wear of different makes of tractor tire, knows that the trial and the location of the tire on the (four wheel drive, equal tire size) tractor will significantly affect wear. Latin Square -2 Latin Square Design • A class of experimental designs that allow for two sources of blocking. • Can be constructed for any number of treatments, but there is a cost. If there are t treatments, then t2 experimental units will be required. • If one of the blocking factors is left out of the design, we are left with a design that could have been obtained as a randomized block design. • Analysis of a Latin square is very similar to that of a RBD, only one more source of variation in the model. • Two restrictions on randomization. Latin Square -3 Cold Protection of Strawberries • Three different irrigation methods (treatment levels) are used on strawberries: 1. drip, 2. overhead sprinkler, 3. no irrigation. • We wish to determine which of these is most effective in protecting strawberries from extreme cold. • All strawberries grown through plastic mulch. • Measure weight of frozen fruit (lower values indicate more protection). Latin Square -4 high Moisture Field Layout Nitrogen Level none drip drip over CANAL high Moisture Which design will best allow us to account for both soil moisture and nitrogen gradients? over none over none drip Moisture and Soil Nitrogen are two sources of extraneous variation that we wish to simultaneously control for. low Nitrogen Level none drip drip low over over none over none drip CANAL Latin Square -5 Advantages and Disadvantages Advantages: • Allows for control of two extraneous sources of variation. • Analysis is quite simple. Disadvantages: • Requires t2 experimental units to study t treatments. • Best suited for t in range: 5 t 10. • The effect of each treatment on the response must be approximately the same across rows and columns. • Implementation problems. • Missing data causes major analysis problems. Latin Square -6 Constructing a Latin Square Design for t Treatments • Treatments designated by first t capital letters in the alphabet (A,B,C, etc.) • Number the levels of blocking factor 1 (call it “Rows”) as R1, R2, … Rt. • Number the levels of blocking factor 2 (call it “Columns”) as C1, C2, … Ct. • Assign the treatment letters in alphabetic order, beginning with A, to the t units in the first row. • For the second row, start with the letter B and assign treatment letters to the t-th letter then follow with A. • For rows 3 through t, simply shift the treatment letters up one at a time, placing the shifted letter in the last unit of Latin Square -7 the row. Basic Square C1 C2 C3 C4 R1 A B C D R2 B C D A R3 C D A B R4 D A B C Latin Square -8 Randomization Get a random ordering of the rows. 1234 replaced by 2143 C1 C2 C3 C4 R1 B C D A R2 A B C D R3 D A B C R4 C D A B Reorder the rows according to randomization. Latin Square -9 Randomization Get a random ordering of the columns. 1234 replaced by 4231 C1 C2 C3 C4 R1 A C D B R2 D B C A R3 C A B D R4 B D A C Reorder the columns according to randomization. Two Blocking Factors = Two Randomizations = Two Constraints on Randomization Latin Square -10 Latin Square Linear Model: A Three-Way AOV yij(k ) m ri j t k e ij(k ) , (i, j, k 1,, t ) t yij(k) m ri j tk eij(k) = number of treatments, rows and columns. = observation on the unit in the ith row, jth column given the kth treatment. The indicator k is in parenthesis to remind us that specifying i and j effectively determines the treatment k. = the general mean common to all experimental units. = the effect of level i of the row blocking factor. Usually assumed N(0,sr2), a random effect. = the effect of level j of the column blocking factor. Usually assumed N(0,s2), a random effect. = the effect of level k of treatment factor, a fixed effect. = component of random variation associated with observation ij(k). Usually assumed N(0,se2). Latin Square -11 Latin Square Analysis of Variance Source Rows Columns Trtments Error Total df t-1 t-1 t-1 (t-1)(t-2) t2-1 SSQ SSRow SSCol SSTrt SSE TSS MSQ MSRow MSCol MSTrt MSE F MSRow/MSE MSCol/MSE MSTrt/MSE Latin Square -12 Sums of Squares TSS t (y i , j 1 ij ( k ) y ) 2 t SSRow t ( yi.(.) y ) 2 i 1 t SSCol t ( y. j (.) y ) 2 j 1 t SSTrt t ( yij (.) y ) 2 k 1 SSE TSS SSRow SSCol SSTrt Latin Square -13 Experimental Error Experimental error = response differences between two experimental units that have experienced the same treatment. In this case though, the “replicates” for each treatment are spread across the t row and t column blocks in a specific fashion. Even more so than with randomized block designs, the variability among treatment replicates includes the row and column block effects. In similar fashion as for RCBDs, the specific latin square layout will filter out the extraneous (row & col) sources of variability when performing comparisons of treatment means. Note that this would not have been the case if the experiment had erroneously been laid out as a CRD or RBD… Latin Square -14 Latin Square Mean Squares and F Statistics MSRow = MSCol = MSTrt = MSE = SSRow (t - 1) SSCol (t - 1) SSTrt (t - 1) SSE ((t - 1)(t - 2) Ftrt Frow Fcol MSTrt MSE MSRow MSE MSCol MSE ~ F( t 1),( t 1)( t 2 ) ~ F( t 1),( t 1)( t 2 ) ~ F( t 1),( t 1( t 2 ) We reject the null hypothesis of no main effect if the value of the F-statistic is greater than the 100(1-a)th percentile of the F distribution with degrees of freedom specified above. Latin Square -15 Latin Square Example The strawberry irrigation cold protection study data are given below. The effectiveness of the three irrigation methods was measured by the weight of the frozen fruit, with lower weights representing more effective protection. The study question is “ Which irrigation method provided the most protection?” Row 1 1 1 2 2 2 3 3 3 Column 1 2 3 1 2 3 1 2 3 Treatment Drip Over None None Drip Over Over None Drip Weight 51 119 60 98 43 31 99 87 49 Latin Square -16 Data strawb; input row column irrig $ weight @@; datalines; 1 1 drip 51 1 2 over 119 1 3 none 60 2 1 none 98 2 2 drip 43 2 3 over 31 3 1 over 99 3 2 none 87 3 3 drip 49 ; run; proc glm; class row column irrig; model weight = row column irrig; title 'Strawberry Irrigation Latin Square Exp'; run; Source Model Error Corrected Total DF 6 2 8 R-Square 0.782679 Sum of Squares 5840.000000 1621.555556 7461.555556 Coeff Var 40.23037 Latin Square in SAS Mean Square 973.333333 810.777778 Root MSE 28.47416 F Value 1.20 Pr > F 0.5205 weight Mean 70.77778 Source row column irrig DF 2 2 2 Type I SS 817.555556 2616.222222 2406.222222 Mean Square 408.777778 1308.111111 1203.111111 F Value 0.50 1.61 1.48 Pr > F 0.6648 0.3826 0.4026 Source row column irrig DF 2 2 2 Type III SS 817.555556 2616.222222 2406.222222 Mean Square 408.777778 1308.111111 1203.111111 F Value Pr > F 0.50 0.6648 1.61 0.3826 Latin1.48 Square -17 0.4026 Input Data Analyze > General Linear Model > Univariate Latin Square in SPSS Note: You must use a custom model and only ask for main effects. Latin Square -18 SPSS Ouptut Latin Square -19 Latin Square in Minitab Stat > ANOVA > General Linear Model Latin Square -20 MTB: ANOVA and Sums of Squares General Linear Model: weight versus row, column, irrig Factor row column irrig Type fixed fixed fixed Levels 3 3 3 Values 1, 2, 3 1, 2, 3 drip, none, over Analysis of Variance for weight, using Adjusted SS for Tests Source row column irrig Error Total DF 2 2 2 2 8 S = 28.4742 Seq SS 817.6 2616.2 2406.2 1621.6 7461.6 Adj SS 817.6 2616.2 2406.2 1621.6 R-Sq = 78.27% Adj MS 408.8 1308.1 1203.1 810.8 F 0.50 1.61 1.48 P 0.665 0.383 0.403 R-Sq(adj) = 13.07% Latin Square -21 Latin Square with R > straw <- read.table("Data/latin_square.txt",header=TRUE) > straw.lm <- lm(weight ~ factor(row) + factor(column) + factor(irrig), data=straw) > anova(straw.lm) Analysis of Variance Table Response: weight Df Sum Sq Mean Sq F value factor(row) 2 817.56 408.78 0.5042 factor(column) 2 2616.22 1308.11 1.6134 factor(irrig) 2 2406.22 1203.11 1.4839 Residuals 2 1621.56 810.78 Pr(>F) 0.6648 0.3826 0.4026 Latin Square -22 Medical Example of a Latin Square Latin Square -23 Randomized, controlled, double-blinded, NICE! Design extracts out differences due to time and patients! Latin Square -24