Latin Square (Revised)
Latin Square (Revised)
-With the Latin Square design you are able to control variation in two directions.
2. The experimental error is likely to increase with the size of the square.
3. Small squares have very few degrees of freedom for experimental error.
-One way to increase the Error df for small squares is to use more than one square in the
experiment (i.e. repeated squares).
1
Example
Two 4x4 Latin squares.
SOV Df
Squares sq – 1 = 1
* Row(square) sq(r-1) = 6
* Column(square) sq(r-1) = 6
Treatment r-1 = 3
Square x Treatment (sq-1)(r-1) = 3
* Error sq(r-1)(r-2) = 12
Total sqr2 – 1 = 31
*Additive across squares.
1. Field trials in which the experimental error has two fertility gradients running
perpendicular each other or has a unidirectional fertility gradient but also has residual
effects from previous trials.
Gradient 2
Gradient 1
3. Insecticide field trial where the insect migration has a predictable direction that is
perpendicular to the dominant fertility gradient of the experimental field.
4. Greenhouse trials in which the experimental pots are arranged in a straight line
perpendicular to the glass walls, such that the difference among rows of pots and
distace from the glass wall are expected to be the major sources of variability.
A D C B B C A D D A B C C B D A
2
Randomization Procedure
-Start with the standard square and randomize all columns and all but the first row.
1 2 3 3 1 2
1 A B C C A B
Randomize columns
2 B C A A B C
3 C A B B C A
Standard square
C A B
B C A
A B C
3
Analysis of a Single Latin Square
Example
Grain yield of three maize hybrids (A, B, and D) and a check (C).
Treatment Total
A 5.855
B 5.885
C 4.270
D 5.355
Y..2
CF = 2
r
21.3652
=
42
= 28.53
TotalSS = ∑ Yij2 − CF
= 1.4139
4
Step 4. Calculate the Row SS
RowSS =
∑ Row − CF
r
= 0.0302
Col .SS =
∑ Col − CF
r
= 0.8273
TrtSS =
∑Y i.
− CF
r
= 0.4268
= 0.1296
5
Step 8. Complete the ANOVA table
SOV Df SS MS F
Row r-1 = 3 0.030
Column r-1 = 3 0.827
Trt r-1 = 3 0.427 0.142 Trt MS/Error MS = 6.60*
Error (r-1)(r-2) = 6 0.129 0.0215
Total r2-1 = 15 1.414
2 ErrorMS
LSD = tα
2 r
2(.0215)
= 2.447
4
= 0.254
Linear Model
Yij (t ) = µ + β i + κ j + τ t + ε ij (t )
6
Latin Square - Combined Analysis Across Squares
-The squares can be at the same location, or three different locations, or three different
years, etc.
Example
Square 1
∑R
41 (B) 25 (C) 15 (A) 81 SS Row1 = 126.89
20 (A) 32 (B) 24 (C) 76 SS Column1 = 89.55
22 (C) 12 (A) 21 (B) 55 SS Treatment1 = 368.22
∑C 83 69 60 212 SS Error1 = 21.56
Square 2
∑R
27 (C) 28 (B) 3 (A) 58 SS Row2 = 130.89
4 (A) 17 (C) 9 (B) 30 SS Column2 = 110.22
22 (B) 4 (A) 17 (C) 43 SS Treatment2 = 534.22
∑C 53 49 29 131 SS Error2 = 14.89
Square 3
∑R
43 (B) 27 (C) 17 (A) 87 SS Row3 = 126.89
22 (A) 34 (B) 26 (C) 82 SS Column3 = 89.55
24 (C) 14 (A) 23 (B) 61 SS Treatment3 = 368.22
∑C 89 75 66 230 SS Error3 = 21.56
Step 1. Test the homogeneity of the Error MS from each square using Bartlett’s Chi-
square test.
7
Step 1.3 Calculate the Log of each Error MS
s 2
=
∑s i
=
29.01
= 9.67
p
# sq 3
χ = 2
[( )
2.3026( Errordf ) sq log s 2p − ∑ log si2 ]
⎡
1 + ⎢
(sq + 1) ⎤
⎥
⎣ 3 * sq * Errordf ⎦
0.0869
=
1.2222
= 0.0711
Step 1.6 Look up the Table χ 2 -value at the 99.5% level of confidence and df = #sq-1.
χ 02.005;2df = 10.6
8
Step 2. Calculate Treatment Totals for each square.
Y...2
CF =
sq * r 2
5732
=
3 * 32
= 12,160.333
( )
TotalSS = 412 + 25 2 + 15 2 + ... + 23 2 − CF
= 2,620.67
SquareSS =
∑ Sq − CF
r2
=
(212 2
+ 1312 + 2302 )
− CF
32
= 618.0
= 384.67
9
Step 7. Calculate the Column(Square) SS (Additive across squares)
= 289.32
TrtSS =
∑ TRT i
− CF
sq * r
=
(111 2
+ 2532 + 2092
− CF
)
3*3
= 1,174.22
Sq * TrtSS =
∑ (SqXTrt ) − CF − SquareSS − TrtSS
r
=
(47 2
+ 94 2 + 712 + ... + 77 2 )
− CF − SquareSS − TrtSS
3
= 96.45
Error SS = 58.01
10
Conclusions:
1. The non-significant Square X Treatment interaction indicates that treatments
responded similarly in all squares.
Table 1. Mean for the square x treatment interaction.
Treatment
Square A B C
1 15.7 31.3 23.7
2 3.7 19.7 20.3
3 17.7 33.3 25.7
LSD(0.05) -------------------ns--------------------
2. The significant F-test for Treatment indicates that averaged across all squares, there
were differences between treatments.
3.
Table 2. Mean for the treatment main effect averaged
Across squares.
Treatment Mean
A 12.3
B 28.1
C 23.2
LSD(0.05) 3.6
Square X Trt: Normally, you would not calculate this LSD because the F-test for the
interaction was non-significant. However, if it would have been significant, you would
have calculated the LSD using the following method:
2 ErrorMS
LSDSqXTrt = t a / 2;errordf
r
2(9.67 )
= 2.447
3
= 6 .2
11
Treatment:
2 ErrorMS
LSDTrt = t a / 2;errordf
sq * r
2(9.67 )
= 2.447
3*3
= 3. 6
SAS Commands for the Latin Square (individual squares and combined across
squares).
options pageno=1;
data lscmb;
input square row column trt $ yield;
datalines;
1 1 1 b 41
1 1 2 c 25
1 1 3 a 15
1 2 1 a 20
1 2 2 b 32
1 2 3 c 24
1 3 1 c 22
1 3 2 a 12
1 3 3 b 21
2 1 1 c 27
2 1 2 b 28
2 1 3 a 3
2 2 1 a 4
2 2 2 c 17
2 2 3 b 9
2 3 1 b 22
2 3 2 a 4
2 3 3 c 17
3 1 1 b 43
3 1 2 c 27
3 1 3 a 17
3 2 1 a 22
3 2 2 b 34
3 2 3 c 26
3 3 1 c 24
3 3 2 a 14
3 3 3 b 23
;;
ods graphics off;
ods rtf file='latin.rtf';
proc print;
12
title 'printout of data';
run;
proc sort;
by square;
*Comment The previous statements are needed to do the ANOVA for each
individual square;
run;
proc anova;
by square;
class row column trt;
model yield=row column trt;
title 'anova of each individual square';
run;
proc anova;
class square row column trt;
model yield=square row(square) column(square) trt square*trt;
means trt/lsd;
means square*trt;
*Comment Note that there is no LSD command since SAS will not
calculate the LSD values for interactions. SAS only calculates LSD
values for the main effects;
title 'anova combined across squares assuming square and trt are fixed
effects';
run;
proc anova;
class square row column trt;
model yield=square row(square) column(square) trt square*trt;
test h=trt e=square*trt;
*Comment The previous statement is needed since square is a random
effect and treatment is a fixed effect. Squre*trt is the denominator
of the F-test to test treatment;
means trt/lsd e=square*trt;
means square*trt;
*Comment Note that there is no LSD command since SAS will not
calculate the LSD values for interactions. SAS only calculates LSD
values for the main effects;
title 'anova combined across squares assuming square random and trt
fixed';
run;
ods rtf close;
13
03:49 Sunday, October 20, 2013 1
Printout of Data for the Latin Square
3 1 1 3 a 15
4 1 2 1 a 20
5 1 2 2 b 32
6 1 2 3 c 24
7 1 3 1 c 22
8 1 3 2 a 12
9 1 3 3 b 21
10 2 1 1 c 27
11 2 1 2 b 28
12 2 1 3 a 3
13 2 2 1 a 4
14 2 2 2 c 17
15 2 2 3 b 9
16 2 3 1 b 22
17 2 3 2 a 4
18 2 3 3 c 17
19 3 1 1 b 43
20 3 1 2 c 27
21 3 1 3 a 17
22 3 2 1 a 22
23 3 2 2 b 34
24 3 2 3 c 26
25 3 3 1 c 24
26 3 3 2 a 14
27 3 3 3 b 23
03:49 Sunday, October 20, 2013 2
ANOVA of each individual square
square=1
Class Level
Information
Class Levels Values
row 3 123
column 3 123
trt 3 abc
square=1
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 6 584.6666667 97.4444444 9.04 0.1029
square=2
Class Level
Information
Class Levels Values
row 3 123
column 3 123
trt 3 abc
square=2
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 6 775.3333333 129.2222222 17.36 0.0555
square=3
Class Level
Information
Class Levels Values
row 3 123
column 3 123
trt 3 abc
square=3
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 6 584.6666667 97.4444444 9.04 0.1029
Class Level
Information
Class Levels Values
square 3 123
row 3 123
column 3 123
trt 3 abc
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 20 2562.666667 128.133333 13.26 0.0021
Error 6 58.000000 9.666667
Note: This test controls the Type I comparisonwise error rate, not the experimentwise error rate.
Alpha 0.05
B 23.222 9 c
C 12.333 9 a
03:49 Sunday, October 20, 2013 11
ANOVA combined across squares assuming square and trt are fixed effects
yield
Level of Level of
square trt N Mean Std Dev
1 a 3 15.6666667 4.0414519
1 b 3 31.3333333 10.0166528
1 c 3 23.6666667 1.5275252
2 a 3 3.6666667 0.5773503
2 b 3 19.6666667 9.7125349
2 c 3 20.3333333 5.7735027
3 a 3 17.6666667 4.0414519
3 b 3 33.3333333 10.0166528
3 c 3 25.6666667 1.5275252
03:49 Sunday, October 20, 2013 12
anova combined across squares assuming square random and trt fixed
Class Level
Information
Class Levels Values
square 3 123
row 3 123
column 3 123
trt 3 abc
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 20 2562.666667 128.133333 13.26 0.0021
Error 6 58.000000 9.666667
Note: This test controls the Type I comparisonwise error rate, not the experimentwise error rate.
Alpha 0.05
B 12.333 9 a
ANOVA combined across squares assuming square random and trt fixed
yield
Level of Level of
square trt N Mean Std Dev
1 a 3 15.6666667 4.0414519
1 b 3 31.3333333 10.0166528
1 c 3 23.6666667 1.5275252
2 a 3 3.6666667 0.5773503
2 b 3 19.6666667 9.7125349
2 c 3 20.3333333 5.7735027
3 a 3 17.6666667 4.0414519
3 b 3 33.3333333 10.0166528
3 c 3 25.6666667 1.5275252