1. Home
  2. AGQLATIN procedure

AGQLATIN procedure

Generates complete and quasi-complete Latin squares (R.W. Payne).


PRINT = string token Controls printing of the design (design); if unset in an interactive run AGQLATIN will ask whether the design is to be printed, in a batch run the default is not to print anything
ANALYSE = string token Controls whether or not to analyse the design, and produce a skeleton analysis-of-variance table using ANOVA (no, yes); default is to ask if this is unset in an interactive run, and not to analyse if it is unset in a batch run


NROWS = scalars Specifies the number of rows (and columns) in the square
SEED = scalars Seed to be used to randomize each design; a negative value implies no randomization
TREATMENTS = factors Identifier for the treatment factor
ROWS = factors Identifier for the row factor
COLUMNS = factors Identifier for the column factor
STATEMENT = texts Saves a command to recreate each design (useful if the design information has been specified in response to questions from AGQLATIN)


A complete Latin square is a Latin square in which each ordered pair of treatments appears exactly once within the rows of the square, and exactly once within the columns. For example, in the four-by-four square below, the pair (1,2) is in row 1 (and only in row 1) while the pair (2,1) is only in row 4. Likewise (1,2) is only only in column 1 and (2,1) only in column 4.

 Columns 1 2 3 4


       1 1 2 4 3

       2 2 3 1 4

       3 4 1 3 2

       4 3 4 2 1

A quasi-complete Latin has similar properties, but here each unordered pair occurs exactly twice within the rows, and exactly twice within the columns. See, for example, the five-by-five Latin square below.

 Columns 1 2 3 4 5


       1 1 2 5 3 4

       2 2 3 1 4 5

       3 5 1 4 2 3

       4 3 4 2 5 1

       5 4 5 3 1 2

Complete Latin squares can be constructed for any even number of rows, while quasi-complete squares are available for any odd number of rows. Designs based on these squares are useful for example in experiments where there is the possibility of interference between a plot and its neighbours. Complete Latin squares should be used if the interference is likely to be directional, as for example in a field experiment to assess fungicides where spores may be carried from one plot to another by a prevailing wind. Otherwise the choice of design will depend upon wether an odd or even number of treatments is required.

AGQLATIN is easiest to use interactively. All the information required to generate the design 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 AGQLATIN 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 square (i.e. the number of rows and columns) can be specified by the NROWS option. The ROWS, COLUMNS and TREATMENTS parameters can supply identifiers for the row, column and treatment factors, so that they are accessible outside the procedure.

The SEED parameter allows you to specify a seed to randomize the design, by making a random permutation of the treatment labels. In a batch run, SEED 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).

The PRINT option can be set to design to print the design. By default, if you are running Genstat in batch, the nothing is printed. If you do not set PRINT when running interactively, AGQLATIN will ask what you want to print. Similarly the ANALYSE option governs whether or not AGQLATIN produces a skeleton analysis-of-variance table (containing just source of variation, degrees of freedom and efficiency factors). Again AGQLATIN 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.




AGQLATIN uses the method of Williams (1949), which is based upon terraced groups (Bailey 1984).


Bailey, R.A. (1984). Quasi-complete Latin squares: construction and randomization. Journal of the Royal Statistical Society Series B, 46, 323-334.

Williams, E.J. (1949). Experimental designs balanced for the estimation of residual effects of treatments. Australian Journal of Scientific Research Series A, 2, 149-168.

See also

Commands for: Design of experiments, Analysis of variance.


CAPTION   'AGQLATIN example',\
          'This generates a complete Latin square of size 6.';\
AGQLATIN  [PRINT=design; ANALYSE=yes] 6; TREATMENTS=Treatment; ROWS=Row;\
          COLUMNS=Column; SEED=371341
Updated on February 6, 2023

Was this article helpful?