Example 7.10 Hyper-Graeco-Latin Square Design

[See FACTEX7A in the SAS/QC Sample Library]A Latin square is an arrangement of symbols, each repeated times, in a square of side such that each symbol appears exactly once in each row and in each column. Such arrangements are useful as designs for row-and-column experiments, where it is necessary to balance the effects of two -level factors simultaneously.

A Graeco-Latin square is actually a pair of Latin squares; when superimposed, each symbol in one square occurs exactly once with each symbol in the other square. The following is an example of a Graeco-Latin square, where Latin letters are used for the symbols of one square and Greek letters are used for the symbols of the other:

     

Whenever is a power of a prime number, you can construct up to squares, each with symbols that are balanced over all the other factors. The result is called a hyper-Graeco-Latin square or a complete set of mutually orthogonal Latin squares. Such arrangements can be useful as designs (refer to Williams 1949), or they can be used to construct other designs.

When is a prime power, hyper-Graeco-Latin squares are straightforward to construct with the FACTEX procedure. This is because a complete set of mutually orthogonal Latin squares is equivalent to a resolution 3 design for -level factors in runs, where two of the factors index rows and columns and each of the remaining factors indexes the treatments of one of the squares.

For example, the following statements generate a complete set of three mutually orthogonal Latin squares, with rows indexed by the factor Row, columns indexed by the factor Column, and the treatment factors in the respective squares indexed by t1, t2, and t3. The first step is to construct a resolution 3 design for five 4-level factors in 16 runs.

proc factex;
   factors Row Column t1-t3 / nlev=4;
   size design=16;
   model resolution=3;
   output out=OrthArray t1 cvals=('A' 'B' 'C' 'D')
                        t2 cvals=('A' 'B' 'C' 'D')
                        t3 cvals=('A' 'B' 'C' 'D');
run;
data _null_;
   array t{3} $ t1-t3;
   array s{4} $ s1-s4; /* Buffer for holding each row      */
   file print;         /* Direct printing to output screen */
   do square=1 to 3;
      put "Square " square ":";
      n = 1;
      do r=1 to 4;
         do c=1 to 4;
            set OrthArray point=n; n=n+1;
            s{c}=t{square};
            end;
         put "       " s1-s4;
         end;
      put;
      end;
   stop;
run;

In most cases, the form that appears in the output data set OrthArray is most useful. The form that usually appears in textbooks is displayed in Output 7.10.1, which can be produced by using a simple DATA step (not shown here).

Output 7.10.1 Hyper-Graeco-Latin Square
Square 1 :                                                                  
       A D B C                                                              
       D A C B                                                              
       B C A D                                                              
       C B D A                                                              

Square 2 :                                                                  
       A D B C                                                              
       C B D A                                                              
       D A C B                                                              
       B C A D                                                              

Square 3 :                                                                  
       A D B C                                                              
       B C A D                                                              
       C B D A                                                              
       D A C B