Transcript Three or More Factors: Latin Squares
Three or More Factors:
Example:
Latin Squares
Three factors, A (block factor), B (block factor), and C (treatment factor), each at three levels. A possible arrangement:
B 1 C 1 B 2 C 1 B 3 C 1 A 1 A 2 C 2 C 2 C 2 A 3 C 3 C 3 C 3 1
Notice, first, that these designs are squares; all factors are at the same number of levels, though there is no restriction on the nature of the levels themselves. Notice, that these squares are balanced: each letter (level) appears the same number of times; this insures unbiased estimates of main effects. How to do it in a square? Each treatment appears once in every column and row.
Notice, that these designs are incomplete; of the 27 possible combinations of three factors each at three levels, we use only 9.
2
Example: Three factors, A (block factor), B (block factor), and C (treatment factor), each at three levels, in a Latin Square design; nine combinations.
B 1 B 2 B 3 A 1 C 1 C 2 C 3 A 2 C 2 C 3 C 1 A 3 C 3 C 1 C 2 3
Example with 4 Levels per Factor
FACTORS VARIABLE Automobiles Tire positions Tire treatments B 1 A 1 C 4 8 5 5 A B C B 2 four levels four levels four levels B 3 C 3 8 7 7 C 2 8 9 0 Lifetime of a tire (days) C 1 B 4 9 9 7 C 1 C 3 C 4 A 2 A 3 A 4 C 3 C 2 9 6 2 C 2 8 4 8 C 4 C 1 8 3 1 8 1 7 8 4 1 9 5 2 C 1 C 4 8 4 5 7 8 4 8 0 6 C 2 C 3 7 7 6 7 7 6 8 7 1
4
The Model for (Unreplicated) Latin Squares
Example :
y ijk = Three factors r , t , and g each at m levels, + r i + t j Y = A + B + C + e i = 1,... m + g k + ijk j =1, ..., m k=1, ... ,m AB, AC, BC, ABC
Note that interaction is not present in the model.
Same three assumptions: normality, constant variances, and randomness.
5
Putting in Estimates:
y
ijk
= y ...
+ ( y
i
..
– y ...
) + ( y .
j
.
– y ...
) + ( y ..
k – y ...
) + R
or bringing y ••• to the left
– (y ijk –y ...) = (y
i
.. – y ...) + (y .j . – y...) + (y ..k – y ...) + R,
Total variability among yields where R =
=
y ijk
Variability among yields associated with Rows
–
y
–
i
..
y
+
Variability among Variability among yields associated
+
yields associated with
.
j
.
Columns
–
y
..
k
+ 2
y
...
with Inside Factor
6
Actually, R
=
y ijk
= (
y ijk
-
y i
..
-
y
...
)
y
.
j
.
-
y
..
k
+ 2
y
...
(
y i
..
-
y
...
) (
y
.
j
.
-
y
...
) (
y
..
k
-
y
...
),
An “interaction-like” term. (After all, there’s no replication!)
7
The analysis of variance (omitting the mean squares, which are the ratios of second to third entries), and expectations of mean squares:
Source of variation Row s C olumns Inside factor Sum of squares D egrees of freedom
m i m
= 1 (
y i
..
–
m m j
= 1 (
y
.
j
.
–
y
...
) 2
y
...
) 2
m m k
= 1 (
y
..
k
–
y
...
) 2 by subtraction
m
– 1
m
– 1
m
– 1 (
m
– 1)(
m
– 2) Expected value of mean square 2 +
V Rows
2 +
V Col
2 +
V Inside factor
2 Error Total
i
j
k
(
y ijk
–
y
...
) 2
m
2 – 1 8
The expected values of the mean squares immediately suggest the F ratios appropriate for testing null hypotheses on rows, columns and inside factor.
9
A1
Auto.
A2 A3 A4
Our Example:
(Inside factor = Tire Treatment)
B1
Tire Position
B2 B3 B4 4 855 1 962 3 848 2 831 3 877 2 817 4 841 1 952 2 890 3 845 1 784 4 806 1 997 4 776 2 776 3 871 10
General Linear Model: Lifetime versus Auto, Postn, Trtmnt
Factor Type Levels Values Auto fixed 4 1 2 3 4 Postn fixed 4 1 2 3 4 Trtmnt fixed 4 1 2 3 4 Analysis of Variance for Lifetime, using Adjusted SS for Tests Source DF Seq SS Adj SS Adj MS F P Auto 3 17567 17567 5856 2.17 0.192
Postn 3 4679 4679 1560 0.58 0.650
Trtmnt 3 26722 26722 8907 3.31 0.099
Error 6 16165 16165 2694 Total 15 65132 Unusual Observations for Lifetime Obs Lifetime Fit SE Fit Residual St Resid 11 784.000 851.250 41.034 -67.250 -2.12R 11
OUR EXAMPLE A1 A2 A3 A4 C4 B1 855 C1 962 C3 848 C2 831 C3 B2 877 C2 817 C4 841 C1 952 C2 B3 890 C3 845 C1 784 C4 806 C1 B4 997 C4 776 C2 776 C3 871 SPSS: Su m of Mean Sou rce of Variation Squ ares DF Squ are F p -valu e Service Policy 17566.5 3 5855.5 2.173 .192
H ou rs Op en 4678.5 3 1559.5 .579 .650
Am enities 26722.5 3 8907.5 3.306 .099
Resid u al 16164.5 6 2694.1
Total 65132.0 15 12
SPSS/Minitab DATA ENTRY
VAR1 VAR2 VAR3 VAR4 855 1 1 4 962 848 831 877 817 2 3 4 1 2 1 1 1 2 2 1 3 2 3 2 .
.
.
871 .
.
.
4 .
.
4 .
.
.
3 .
13
Latin Square with REPLICATION
• Case One: using the same rows and columns for all Latin squares.
• Case Two: using different rows and columns for different Latin squares.
• Case Three: using the same rows but different columns for different Latin squares. 14
Treatment Assignments for n Replications
• Case One: repeat the same Latin square n times.
• Case Two: randomly select one Latin square for each replication.
• Case Three: randomly select one Latin square for each replication.
15
Example: n = 2, m = 4, trtmnt = A,B,C,D
Case One: row 1 2 3 4 1 A B C D 2 column 3 B C C D D A A B 4 D A B C row 1 2 3 4 1 A B C D 2 column 3 B C C D D A A B • Row = 4 tire positions; column = 4 cars 4 D A B C 16
Case Two row 1 2 3 4 1 A B C D 2 column 3 B C C D D A A B 4 D A B C row 5 6 7 8 5 B A D C 6 column 7 C D D C B A A B 8 A B C D • Row = clinics; column = patients; letter = drugs for flu 17
Case Three row 1 2 3 4 1 A B C D 2 column 3 B C C D D A A B 4 D A B C 5 B A D C 6 C D B A 7 D C A B 8 A B C D • Row = 4 tire positions; column = 8 cars 18
ANOVA for Case 1
SSB R , SSB C , SSB IF are computed the same way as before, except that the multiplier of (say for rows) m (Y i..
-Y … ) 2 becomes mn (Y i..
-Y … ) 2 and degrees of freedom for error becomes (nm 2 - 1) - 3(m - 1) = nm 2 - 3m + 2 19
ANOVA for other cases:
1. SS: please refer to the book,
Statistical Principles of research Design and Analysis
by R. Kuehl. 2. DF: # of levels – 1 for all terms except error. DF of error = total DF – the sum of the rest DF’s.
Using Minitab in the same way can give Anova tables for all cases.
20
Graeco-Latin Squares
In an unreplicated m x m Latin square there are m 2 yields and m 2 - 1 degrees of freedom for the total sum of squares around the grand mean. As each studied factor has m levels and, therefore, m-1 degrees of freedom, the maximum number of factors which can be accommodated, allowing no degree of freedom for factors not studied, is
m m
2 – 1 – 1 =
m
+ 1
A design accommodating the maximum number of factors is called a complete Graeco-Latin square:
21
Example 1: m=3; four factors can be accommodated A 1 A 2 A 3 C 1 D 1 B 1 C 2 D 3 C 3 D 2 C 2 D 2 B 2 C 3 D 1 C 1 D 3 C 3 D 3 B 3 C 1 D 2 C 2 D 1 22
Example 2: m = 5; six factors can be accommodated B 1 B 2 B 3 B 4 B 5 A 1 C 1 D 1 E 1 F 1 C 2 D 2 E 2 F 2 C 3 D 3 E 3 F 3 C 4 D 4 E 4 F 4 C 5 D 5 E 5 F 5 A 2 C 2 D 3 E 4 F 5 C 3 D 4 E 5 F 1 C 4 D 5 E 1 F 2 C 5 D 1 E 2 F 3 C 1 D 2 E 3 F 4 A 3 C 3 D 5 E 2 F 4 C 4 D 1 E 3 F 5 C 5 D 2 E 4 F 1 C 1 D 3 E 5 F 2 C 2 D 4 E 1 F 3 A 4 C 4 D 2 E 5 F 3 C 5 D 3 E 1 F 4 C 1 D 4 E 2 F 5 C 2 D 5 E 3 F 1 C 3 D 1 E 4 F 2 A 5 C 5 D 4 E 3 F 2 C 1 D 5 E 4 F 3 C 2 D 1 E 5 F 4 C 3 D 2 E 1 F 5 C 4 D 3 E 2 F 1 23
In an unreplicated complete Graeco-Latin square all degrees of freedom are used up by factors studied. Thus, no estimate of the effect of factors not studied is possible, and analysis of variance cannot be completed.
24
But, consider incomplete Graeco-Latin Squares: b 1 b 2 b 3 b 4 b 5 a 1 c 1 d 1 c 2 d 2 c 3 d 3 c 4 d 4 c 5 d 5 a 2 c 2 d 3 c 3 d 4 c 4 d 5 c 5 d 1 c 1 d 2 a a a 3 4 5 c 3 d 5 c 4 d 2 c 5 d 4 c c c 4 5 1 d d d 1 3 5 c c c 5 2 1 d d d 2 1 4 c c c 3 1 2 d d d 2 3 5 c c 2 d 4 c 3 d 1 4 d 3
25
We test 4 different Hypotheses.
SOURCE A B C D Error ANOVA TABLE SSQ SSB A SSB B SSB C SSB D SSW df 4 4 4 4 8 • • • • • TSS 24 by Subtraction
26