Generates Latin squares balanced for carry-over effects (R.W. Payne).

### Options

`PRINT` = string token |
Controls printed output (`design` ); if unset in an interactive run `ACROSSOVERGLATIN` 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` (`yes` , `no` ); default is to ask if this is unset in an interactive run, and not to analyse if it is unset in a batch run |

### Parameters

`LEVELS` = scalars or variates |
Number of treatments (scalar) or levels for the treatments |
---|---|

`SEED` = scalars |
Seed to be used to randomize the design; a negative value implies no randomization |

`TREATMENTS` = factors |
Identifier for a factor to represent the direct effects of the treatments |

`SUBJECTS` = factors |
Identifier for a factor to represent the subjects |

`PERIODS` = factors |
Identifier for a factor to represent the periods |

`CARRYOVERFACTOR` = factors |
Identifier for a factor to represent the carry-over (or “residual”) effect of the treatments in the period immediately after the period in which they were applied |

`NOCARRYOVER` = factors |
Identifier for a factor to represent the comparison between none and any carry-over effect of the treatments |

`STATEMENT` = texts |
Saves a command to recreate each design (useful if the design information has been specified in response to questions from `AGCROSSOVERLATIN` ) |

### Description

Cross-over trials are designed to study the effects of various treatments on a set of plots (in a field experiment) or subjects (in a medical trial). The special feature of these experiments is that the same plots or subjects are treated during several successive time periods, and there is interest both in the direct effect of a treatment during the period in which it is applied and its carry-over (or “residual”) effect during later periods. `AGCROSSOVERLATIN`

can generate designs for a single treatment factor for the most usual situation, where the carry-over effect is assumed to last over only one subsequent period. The design balances the direct and carry-over effects by ensuring that each treatment follows each other treatment an equal number of times. For an even number of treatments *t* the design consists of a single *t* × *t* Latin square, while for an odd number *t* it is formed from a pair of Latin squares.

The design can be analysed by `ANOVA`

by setting

`BLOCKSTRUCTURE Subjects * Periods`

`TREATMENTSTRUCTURE Nocarryover / Carryoverfactor + Treatments`

The factor `Carryoverfactor`

represents the carry-over effects of the treatments, and factor `Nocarryover`

assesses whether there were any carry-over effects at all (essentially this is a comparison between the periods 2 onwards where there were carry-over effects from earlier times, and period 1 where there was none). So the treatment formula expands to specify terms

`Nocarryover` |
none versus any carry-over effect |
---|---|

`Nocarryover.Carryoverfactor` |
differences in carry-over effect amongst the treatments (assuming that there was an earlier treatment) |

`Treatments` |
direct effects of treatments, eliminating any carry-over effect |

The direct and carry-over effects are not orthogonal, so it may be of interest also to specify

`TREATMENTSTRUCTURE Treatments + Nocarryover / Carryoverfactor`

in order to estimate the carry-over effects eliminating the direct effects.

`AGCROSSOVERLATIN`

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 `AGCROSSOVERLATIN`

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 number of treatments can be defined using the `LEVELS`

parameter. The `SEED`

parameter allows you to specify a seed to be used to randomize the design. In batch the default seed is -1, to suppress randomization. If you do not set `SEED`

when running interactively `AGCROSSOVERLATIN`

will ask for a seed, and again a negative value suppresses any randomization.

Parameters `TREATMENTS`

, `CARRYOVERFACTOR`

and `NOCARRYOVER`

allow you to specify identifiers for factors to represent the direct effects of the treatments, the carry-over effects in the subsequent period, and the comparison between none and any carry-over effect. Similar the parameters `SUBJECTS`

and `PERIODS`

can specify identifiers for factors to represent the subjects (or plots) and time periods respectively. If these parameters are not specified in a batch run, `AGCROSSOVERLATIN`

will use identifiers that are local within the procedure and thus lost at the end of the procedure. If you are running interactively, `AGCROSSOVERLATIN`

will ask you to provide identifiers, and these will remain available after `AGCROSSOVERLATIN`

has finished running.

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, `AGCROSSOVERLATIN`

will ask what you want to print. Similarly the `ANALYSE`

option governs whether or not `AGCROSSOVERLATIN`

produces a skeleton analysis-of-variance table (containing just source of variation, degrees of freedom and efficiency factors). Again `AGCROSSOVERLATIN`

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.

Options: `PRINT`

, `ANALYSE`

.

Parameters: `LEVELS`

, `SEED`

, `TREATMENTS`

, `SUBJECTS`

, `PERIODS`

, `CARRYOVERFACTOR`

, `NOCARRYOVER`

, `STATEMENT`

.

### Method

`AGCROSSOVERLATIN`

generates the design using the standard Genstat calculation and manipulation commands.

### See also

Procedures: `AFCARRYOVER`

, `AGLATIN`

, `AGSEMILATIN`

, `AGQLATIN`

, `AGYOUDENSQUARE`

, `GALOIS`

, `XOEFFICIENCY`

, `XOPOWER`

.

Commands for: Design of experiments, Analysis of variance.

### Example

CAPTION 'AGCROSSOVERLATIN example'; STYLE=meta AGCROSSOVERLATIN [PRINT=design; ANALYSE=yes] 5; SEED=33841;\ TREATMENTS=Direct; CARRYOVERFACTOR=Carryover;\ NOCARRYOVER=Nocarryover; SUBJECTS=Subjects; PERIODS=Periods