Generates mutually orthogonal Latin squares (I. Wakeling & R.W. Payne).
|Controls printed output (
||Controls whether or not to analyse the design, and produce a skeleton analysis-of-variance table using
||Specifies the number of rows (and columns) in each square|
||Number of squares to form (i.e. number of treatment factors to generate)|
||Seed to be used to randomize each design; a negative value implies no randomization|
||Pointer to identifiers for the treatment factors|
||Identifier for the row factor|
||Identifier for the column factor|
||Returns the maximum number of squares available with the specified number of rows and columns|
||Saves a command to recreate each design (useful if the design information has been specified in response to questions from
AGLATIN generates a set of orthogonal Latin squares, or a single square. It is easiest to use interactively. All the information required to generate the squares is then obtained by (clearly explained) questions. You need set the parameters only if you wish to anticipate some of the questions, or if you wish to use
AGLATIN in batch. If, however, you wish to recreate the same design later, the
STATEMENT parameter allows you to save a Genstat text structure containing a command specifying the same information.
The size of the squares (i.e. the number of rows and columns) can be specified by the
NROWS option, and the number of squares (i.e. the number of treatment factors to be generated) can be specified by the
NSQUARES option. The
MAXNSQUARES parameter can be used to ascertain how many squares are available. If this is set but
NSQUARES is not set, the procedure then stops. Otherwise, when
AGLATIN is being used interactively, if
NSQUARES is unset you will be asked how many squares you want.
The squares are represented as a row factor, a column factor and
NSQUARES treatment factors all of length
COLUMNS parameters can supply identifiers for the row and column factors, so that they are accessible outside the procedure. The
TREATMENTFACTORS parameter can specify a pointer to supply identifiers for the treatment factors. For example, if there are two factors you could define their identifiers to be
B by forming the pointer
Tf (say) with the statement
POINTER [VALUES=A,B] Tf
and then setting
TREATMENTFACTORS=Tf. Alternatively, and more succinctly, you could put
!p(A,B) is an unnamed pointer containing the required two identifiers.
SEED parameter allows you to specify a seed to randomize the design. In a batch run, this has a default of -1, to suppress randomization. If
SEED is unset in an interactive run, you will be asked to provide a seed (and again a negative value will leave the design unrandomized).
AGLATIN prints the design. The setting
design prints it as a square table of treatment factors tabulated by the row and column factors,
squares prints each treatment factor separately (again tabulated by rows and columns), and
list prints row, column and treatment factor values as a list. By default, if you are running Genstat in batch, the nothing is printed. If you do not set
AGLATIN will ask what you want to print. Similarly the
ANALYSE option governs whether or not
AGLATIN produces a skeleton analysis-of-variance table (containing just source of variation, degrees of freedom and efficiency factors). Again
AGLATIN assumes that this is not required if
ANALYSE is unset in a batch run, and asks whether it is required if
ANALYSE is unset in an interactive run.
If the order of squares required is prime or any integer power of a prime number, the approach is to call
GALOIS to obtain the multiplication table for the field GF[
NROWS] and then cyclically develop the columns from the multiplication table to give the squares.
If the parameter
NROWS is a composite number and, when decomposed into prime powers has a smallest prime power (f = pn) greater than or equal to 3, then it is possible to construct f-1 orthogonal squares using the MacNeish-Mann method (Raghavarao 1971, p. 34). In the event that the smallest prime power is 2, it is possible to generate a single Latin square using the same approach. Essentially this process consists of embedding Galois fields one inside another. For each distinct prime factor the multiplication and addition tables from the corresponding fields are obtained by calling the procedure
GALOIS. Note that while this method is general, it does not guarantee to find the maximum possible number of mutually orthogonal squares of any given order. For example, the following list details the number of squares generated for orders up to and including 40.
Order Number of squares generated
For the orders 10, 14, 18 and 22, the procedure uses self-orthogonal squares (Franklin 1984) to give pairs of orthogonal Latin squares. The first rows of a square one order less than required are defined inside the procedure, these are developed by replacement of one of the broken diagonals with a new symbol and the addition of another row and column to produce a bordered cyclic Latin square. The second square in the pair is simply the transpose of the first.
Franklin, M.F. (1984). Cyclic generation of self-orthogonal Latin squares. Utilitas Mathematica, 25, 135-146.
MacNeish, H.F. (1922). Euler’s squares. Annals of Mathematics, 23, 221-227
Mann, H.B. (1942). The construction of orthogonal Latin squares. Annals of Mathematical Statistics, 13, 418-423.
Raghavarao, D. (1971). Constructions and Combinatorial Problems in Design of Experiments. John Wiley, New York.
CAPTION 'AGLATIN example','This generates a Graeco-Latin square of size 12.';\ STYLE=meta,plain AGLATIN [PRINT=design; ANALYSE=yes] 12; NSQUARES=2;\ TREATMENTFACTORS=!p(Latin,Graeco); ROWS=Rows; COLUMNS=Columns;\ SEED=-1