DMDX uses the same scrambling code from DM and DMTG with a few differences, most notable being that there are no limits on the number of items or blocksizes. DMDX provides the ability to pass an item file through the scramble routines multiple times allowing considerable flexibility for the usual cost of increased complexity, see the
Multi-Scrambling Scramble Keyword.
In addition lists of counters can be used to control item order and execution as
in the Probabilistic
Selection Task. There's more discussion of scramble in the
From Ken's DM and DMTG online manual (http://psy1.psych.arizona.edu/~kforster/dmastr/):
SCRAMBLING THE ITEM FILE
The logic of scrambling.
A purely random ordering of the items does not guarantee an even distribution of conditions across the experiment. For example, by chance, you may have most of the items in one condition placed in the second half of the experiment, and most of the items in another condition placed in the first half.
To circumvent this problem, DM/DMTG first divides the item file up into a number of blocks of items, the size of this block being determined by the BLOCKSIZE parameter (see below). It then randomly orders the items within each block, and then finally randomly orders the blocks themselves. The scramble block size parameter and other scramble parameters are entered on the first line of the item file (the parameter line), along with the other DMASTR parameters.
If you arrange your item file so that the first block consists of an equal number of examples of each type of condition (instead of having all the instances of the first condition together at the beginning of the file), then you can be confident that extraneous serial effects (such as practice or fatigue) are more evenly distributed across conditions. This means that you have a pseudo-random order, not a random order.
A further advantage of scrambling is that no two subjects are likely to receive precisely the same sequence of items. This is important, since a difficult item (on which an error is likely) may increase the reaction-time for the following item. If this is always the same item, then one has introduced a systematic error of measurement for that item. For this reason, it is preferable to scramble the items for each subject
Controlling the way DM scrambles.
Item file scrambling is controlled by means of parameters entered at the top of the item file and $ and \ delimiters in the body of the file.
These appear on the first line of an item file with the other DMASTR parameters (see Item Files). Three parameters may be specified:
BLOCKSIZE: the number of groups to be treated as a block. If this parameter is not specified the item file will not be scrambled.
GROUPING: the number of items to be treated as a group. Normally, this parameter is not specified, and defaults to 1. Suppose, however, the items are arranged as pairs on your item file, e.g., (1,2), (3,4), (5,6). If you wanted item 2 to always follow item 1, and item 4 to always follow item 3, etc., then this parameter should have the value 2. This means that DMASTR will treat each successive pair of items as though they were a single item. Items in a pair will never be separated. Thus the eventual order of items might be: 5, 6, 3, 4, 1, 2.
Note that DMDX has a new grouping ability with the <VariableGrouping> keyword.
SEED: the initial seed for the random number generator. Normally this parameter is not specified, and a different pseudo-random order is created each time the item file is scrambled. If a value is specified, the random number generator will always use that value as its initial seed and thus it will always produce the same pseudo- random order.
These allow some sections of the file to remain in a fixed absolute position within the file. Any material enclosed within a pair of $ symbols will not be scrambled, and the order of this segment relative to the rest of the file will remain constant.
It is important to note that the scramble programs do not respect any of the internal conventions of an ITM file, except for the parameters on the first line and the item delimiter (;). Thus the task instructions, the practice items and the final end-of-experiment message will appear at unpredictable locations unless they are enclosed within $ delimiters. In the following example, the text in bold print will not be moved:
n5 f25 m40 s2 (DM input parameters)
$0 "This is the instruction";
0 "Here is the practice item";
0 "End of practice";$
=004 *"cigarette"/ ;
$0 LB"End of experiment";$
This would generate an item sequence that might look like this:
0 "This is the instruction";
0 "Here is the practice item";
0 "End of practice";
0 LB"End of experiment";
A backslash essentially divides the item file into two or more separate files. Once a backslash is encountered, all the preceding material is scrambled and output, and then the material after the initial backslash is treated as a new input.
Note that in DMDX the backslash must
occur at the start of a line (this is because back slashes are valid path name
The implication of this option is that one can define segments to be scrambled in the normal way, except that the segments retain a fixed serial order relative to each other. So for example, if you had an experiment with two different tasks, and it was important to make sure
that all the items for one task were presented before all the items on the second task, then a backslash separating the two phases of the experiment is required. If this option is not used, then you will find that items from the second phase will appear in the first, and vice versa.
Fixed Item Order.
If you want your items presented in the same scrambled order to all subjects, specify an initial seed for the random number generator (see above).
If you do not want your item file to be scrambled at all, omit the scramble blocksize parameter from the first line of the file.