## DesignSequence Page for Sensory Studies that are Balanced for Carry-over and Position Effects (Aletta Nonyane and Chris Theobald)

This page is concerned with how to generate the design sequences considered in the following paper:

*Design Sequences for Sensory Studies: Achieving Balance for Carry-over and Position Effects*

by Aletta Nonyane and Chris Theobald. This paper is published in the British Journal of Mathematical and Statistical Psychology, volume 60 (2007), pages 339-349. Sequences of this type were introduced in the paper "*Serially balanced sequences in bioassay"* by D J Finney and A D Outhwaite (Proceedings of the Royal Society, B, 145 (1956), 493-507), who referred to them as 'type 1 sequences with index 1'. In this context, 'type 1' means that self-adjacencies of treatments (or equivalently of symbols) are included, and 'index 1' that each ordered pair of treatments occurs once in each sequence. Such a sequence for *n* treatments has length *n^*2 +1.

For an example of the use of such a design with *n = 28* in a study of neural activity, see "*Continuous carry-over designs for fMRI"* by G K Aguirre (NeuroImage, 35 (2007), 1480-1494).

**Existence of the Sequences**

Only two sequences with the required properties (1 1 2 2 1 and 2 2 1 1 2) exist for 2 treatments, and none exist for 3, 4 or 5 treatments. We have found sequences for all numbers of treatments between 6 and 34, and enumerated them for 6 and 7 treatments. There was no special reason for ending the search at 34 treatments.

**Programs for Systematic and Random Search of Type 1 Sequences with Index 1**

The C++ program **designseqsys.cpp** generates type 1 sequences with index 1 and standard order (defined below) according to the systematic procedure described in Appendix 1 of Nonyane and Theobald's paper.

The program requires two integers as input (in free format): the number of treatments and the maximum number of seconds that the program is allowed to run.

The program has been run to completion only for 6 and 7 treatments: the sequences listed for these cases minimize criterion (5) defined in the paper. Where several sequences minimize this criterion, one minimizing criterion (4) among them is shown.

For larger numbers of treatments, it appears impractical to generate all possible sequences and then choose between them. It is possible to truncate the search after a fixed time or a fixed number of sequences, but as the number of treatments increases the sequences found in a fixed time presumably form a decreasing proportion of the totality of sequences for that number: the resulting sequences may all appear poor according to criteria (4) and (5). Instead a second C++ program **designseqran.cpp** may be used to generate sequences at random. When this program finds a valid sequence that has a lower value of criterion (5) than any previous sequence, it prints the sequence together with its values of criteria (4) and (5), generates a new random initial sequence, and starts another search.

The 'random' algorithm is described in more detail in:

In practice the 'random' program has been set to run for a fixed number of seconds given as data to the program. When the program times out, the number of valid sequences found so far is shown in the output. It was run for 4 hours for each value of *n* listed below.

**List of Sequences**

Note that the sequences are in *standard order*, meaning that the first *n*+1 symbols in each sequence with *n* symbols are 1 1 2 3 ... *n*. When the sequences are used for designing experiments, the treatments should be assigned to symbols at random.

**Finding Further Sequences**

Although a single sequence is provided for each number of treatments in the above list, further sequences can be generated from them for designing experiments, as follows.

- If there are
*n*treatments, they may be assigned to symbols in*n*! ways. - As explained in Section 4 of the paper, sequences may be reversed, and blocks at the start of the sequence may also be moved to the end: both operations preserve the properties of the sequences.

These two methods may be combined. If they prove inadequate, either of the above programs may be copied and run to generate further sequences.

**Authors:** Aletta Nonyane and Alec Mann**PhD Supervisor:** Chris Theobald

University of Edinburgh and Biomathematics & Statistics Scotland

Date of this version: September 2006

**Acknowledgements:** This work was supported by funds from the Environment and Rural Affairs Department of the Scottish Executive, and Aletta Nonyane was supported by the Cecil Renaud Charitable and Educational Trust.

Email: Chris Theobald