How to Scramble Items

 

So why would you want to scramble your items?  Usually because you, as a researcher, are concerned that no two subjects receive the items in the same sequence because of practice, order, or item level effects but there are too many items to fully counterbalance the item presentation orders across participants.

 

The following keywords are used to control scrambling:

<s N>

<g N>

$

\

 

There are 2 types of scrambling in DMDX.

 

1.                  Scrambling items (unconstrained or within blocks)

The most basic form of scrambling is to scramble every item in your file in a completely unconstrained random order.  In this case, a “block” of items is equal to 1, and you would have <s 1> in your header.

 

However, usually we want a quasi-random order rather than an unconstrained random order because if we simply scramble all of the items in an experiment, it is possible that all of a certain type of item could occur at the beginning or end of the experiment. In other words, unconstrained random scrambling does not assure that the types of items will be evenly distributed throughout the experiment, and in fact, they often will be very “non-random” looking.   For example, in the following itemfile for a simple Go/NoGo task, participants are supposed to press a button every time the word “Go” is displayed but make no response on trials where the word “NoGo” is presented.  Go trials are designed to be infrequent (20% of total trials). 

 

<fd 1><d 29><vm 1024,768,768,16,60><cr><nfb><s 1><t 1000>

$

0 “Press SPACEBAR to start task”;

$

^101 * “NoGo”<% 15>/<% 60>/;

^102 * “NoGo” <% 15>/<% 60>/;

^103 * “NoGo” <% 15>/<% 60>/;

^104 * “NoGo” <% 15>/<% 60>/;

^105 * “NoGo” <% 15>/<% 60>/;

^106 * “NoGo” <% 15>/<% 60>/;

^107 * “NoGo” <% 15>/<% 60>/;

^108 * “NoGo” <% 15>/<% 60>/;

^109 * “NoGo” <% 15>/<% 60>/;

^110 * “NoGo” <% 15>/<% 60>/;

^111 * “NoGo” <% 15>/<% 60>/;

^112 * “NoGo” <% 15>/<% 60>/;

+201 * “Go” <% 15>/<% 60>/;

+202 * “Go” <% 15>/<% 60>/;

+203 * “Go” <% 15>/<% 60>/;

$

0 "End";

$

 

However, the local probability among smaller subsets of items in the above item-file can depart quite significantly from that probability.  In fact, it is possible for some runs of the item-file to have the first three trials (or the last three trials, etc.) be “Go” trials followed by 12 “NoGo” trials. 

 

By scrambling items in smaller subsets or “blocks”, we can execute better control over the local probabilities of the various item types.  To understand this type of scrambling, it is essential to note that a “block” of items in DMDX is NOT the same as what we usually think of as an experimental block. Rather, it is simply an arbitrary subset of items in the experiment.

 

For example, in our Go/NoGo example, if we wanted to be sure to spread the Go trials out across the 15 items and be certain that one Go trial was guaranteed within each block of 5 items we would use <s 5> and then re-order the items so that each block of 5 items contained 1 Go trial and 4 NoGo trials.  In this revised item-file, DMDX would first randomly scramble the items within each block of five items and then it will randomly scramble the 3 blocks of items.  Therefore, the local probability of Go trials would be 20% within each block of 5 (Of course, it is still possible to have two Go trials in a row if one block ends with a Go trial and the following block of five starts with a Go trial).

 

<fd 1><d 29><vm 1024,768,768,16,60><cr><nfb><s 5><t 1000>

$

! NOTE: the blank lines are not necessary.  They are included to highlight the blocked feature of the item ordering;

0 “Press SPACEBAR to start task”;

$

^101 * “NoGo”<% 15>/<% 60>/;

^102 * “NoGo”<% 15>/<% 60>/;

^103 * “NoGo”<% 15>/<% 60>/;

^104 * “NoGo”<% 15>/<% 60>/;

+201 * “Go”<% 15>/<% 60>/;

 

^105 * “NoGo”<% 15>/<% 60>/;

^106 * “NoGo”<% 15>/<% 60>/;

^107 * “NoGo”<% 15>/<% 60>/;

^108 * “NoGo”<% 15>/<% 60>/;

+202 * “Go”<% 15>/<% 60>/;

 

^109 * “NoGo”<% 15>/<% 60>/;

^110 * “NoGo”<% 15>/<% 60>/;

^111 * “NoGo”<% 15>/<% 60>/;

^112 * “NoGo”<% 15>/<% 60>/;

+203 * “Go”<% 15>/<% 60>/;

$

0 "End";

$

 

 

2.                  Scrambling groups of items

In some tasks, you may want to be sure that subsets of items always remain “linked” to each other and in the same order.  In this instance, you would use the grouping keyword, <g N>.  N will specify the number of items to group together.  Scrambling will then proceed as if this group of items was a single item.  For example, in the following item-file, “two” will always follow “one”, “four” will always follow “three”, and “six” will always follow “five.” 

 

<fd 1><d 29><vm 1024,768,768,16,60><cr><nfb><s 1><g 2>

$

0 “Press SPACEBAR to start task”;

$

1 “One”<% 15>/<% 60>/;

2 “Two”<% 15>/<% 60>/;

3 “Three”<% 15>/<% 60>/;

4 “Four”<% 15>/<% 60>/;

5 “Five”<% 15>/<% 60>/;

6 "Six"<% 15>/<% 60>;

$

0 "End";

$

 

However, a run might proceed like this:     Three, four, one, two, five, six; 

or like this: five, six, three, four, one, two

 

Note that in this example, pairs of items are considered one item for the purpose of specifying N in the <s N> keyword.  In other words, there are only three items in the above example.

 

For a real life example, see the slide rating task demo where trials are grouped into groups of 3.  The first item presents a photographic image which the participant views for as long as they choose.  When the are finished viewing the image they first rate the valence of the image and then the arousal of the image.

 

Other details:

The $ delimiters should be placed BEFORE and AFTER anything that you DO NOT want scrambled (e.g., experiment instructions). For example, in our examples above, we don’t want to scramble the start and end messages.  Therefore, they are surrounded by $ and will remain at the start and end of the item file.

 

The backslash (\) delimiter should be placed BETWEEN EXPERIMENTAL BLOCKS that you wish to present in a FIXED order.  This terminates each set of items and basically creates multiple independent item files within your file. When DMDX encounters a slash, it treats the subsequent information as if it were a new item file.

 

Finally, DMDX provides the option to do even more complex scrambling using the Multi-scrambling Scramble Keyword.  However, we have yet to need this function so will leave the description of its use to the DMDX help files.

 

Created by Jessica Shackman

Last edited on 11-29-2005