IAT XML

Is current?: 
Yes

Race IAT XML Code

This entry shows how to create a race Implicit Association Test (or IAT) using the iatrace1.xml and iatrace2.xml files (links below).

The race IAT measures the strength of associations between two concepts (African Americans, European Americans) and two attributes (pleasant, unpleasant). In the Race IAT,.  Paricipants categorizes the exemplars representing these categories (Black vs. White faces and Pleasant vs. Unpleasant words) using the I and E keys on their keyboard.

File Heading

The first three lines of an IAT xml file do not need to be altered for any standard IATs you will run on the infrastructure.  It sets the type of  xml code, calls up the IAT system, and starts the IAT code with an open tag.  The ‘results=”true”’ text sets up your IAT to record participant responses and results.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE IAT SYSTEM "https://implicit.harvard.edu/implicit/research/library/dtd/ImplicitIAT_001.dtd">

<IAT results="true">

 

IAT Name

<IATName>iatrace1</IATName>

This line of code sets the name that will show up in your data files.  Make sure the name is different for each IAT you have in one experiment file.  Note that this is “iatrace2” in the iatrace2.xml file.  Keeping these names consistent wil aid in later data cleaning.

IAT Categories

Each of the 4 categories you use in the IAT requires the same basic lines of code.  In the Race IAT there are two attribute categories (pleasant and unpleasant words) and two concept categories (white and black faces.

The categories begin with this tag:

<Categories>

 

Attribute Categories

Typically, the first two categories are attributes, and therefore word stimuli categories. The attribute categories (Numbered 0 and 1) follow this outline:

<Category color="ffff00">

<CategoryNumber>0</CategoryNumber>

<Stimuli>

<CategoryName>Good</CategoryName>

<CategoryImgURL/>

<Stimulus type="word">Joy</Stimulus>

<Stimulus type="word">Wonderful</Stimulus>

<Stimulus type="word">Love</Stimulus>

<Stimulus type="word">Pleasant</Stimulus>

<Stimulus type="word">Laughter</Stimulus>

<Stimulus type="word">Happy</Stimulus>

</Stimuli>

</Category>

The category color is set to yellow with “ffff00” for the attribute categories. Make sure to include the open <Stilmuli> and close </Stimuli> lines surrounding the name and stimuli. 

Then the Category Name is set to match the stimuli in this attribute category.  Category 0 is names “Good” for the Race IAT.  This word will appear on the right top of the screen to indicate the key pairing as the IAT is running for your participants. 

Since the attribute categories are words, the Category Image URL is not defined and the stimulus type is “word”. Make sure the close each category with a </Category> tag.

The second attribute category, Category Number 1, follows the same pattern.  Note the name is changed to “Bad” and the stimuli are changed to  unpleasant words.

 

Concept Categories              

For the race IAT, the two concept categories are black and white faces.  In our examples, they are numbered <CategoryNumber> “2” and “3”. The concept categories use the same basic code as the attribute categories with a few notable exceptions. 

<Category color="33ff33">

<CategoryNumber>2</CategoryNumber>

<Stimuli>

<CategoryName>White People</CategoryName>

<CategoryImgURL/>

<Stimulus type="image">wf2_nc.jpg</Stimulus>

<Stimulus type="image">wm1_nc.jpg</Stimulus>

<Stimulus type="image">wf6_nc.jpg</Stimulus>

<Stimulus type="image">wf3_nc.jpg</Stimulus>

<Stimulus type="image">wm4_nc.jpg</Stimulus>

<Stimulus type="image">wm6_nc.jpg</Stimulus>

</Stimuli>

</Category>

The Category color is “33ff33” to make the exemplar name (either “White People” or “Black People”) appear in green. The stimulus type for the race IAT or others that use pictures as stimuli is “image”.  The JavaScript IAT template in your experiment file calls these images up from the common folder, so no image path is needed for this file (Note: the path is still needed in the html IAT instructions). The file name of each image is within the <Stimulus> tags.  Remember to use the open and close <Stimuli>,</Stimuli> and close </Category> tags in each category section. The fourth and last category, or Category 3, is in the same format.  After the last Category, in this case named “Black People”, be sure to use a close </Categories> tag.

 

Running Code

The next part of the xml file determines the order and number of trials of the IAT as it will run in your experiment. Each Block of the IAT uses the same basic code.  All 7blocks are defined in this section of the file.

Start the code for each block with a block tag:

<Block limitSequence="true">

Next come the instructions for that Block.  The first block of the race IAT establishes the location of the concept category labels for the first half of the IAT.

<Instructions><![CDATA[<font size="16"><p>Put your middle or index fingers on the <b>E</b> and <b>I</b> keys.<br>Faces will appear one-by-one in the middle of the screen.<br>Press the <b>E</b> key for faces of <b><font color="#33FF33">White People</font></b>.<br>Press the <b>I</b> key for faces of <b><font color="#33FF33">Black People</font></b>.<br><br>If you make an error, an <font color="#FF0000"><b>X</b></font> will appear.<br>Fix the error by pressing the other key.<br /><b>GO AS FAST AS YOU CAN</b> and be accurate. </p><br /><p align="center">Press the <b>space bar</b> to begin.</p></font>]]></Instructions>

Notice the font colors for the categories match the category colors defined earlier in the file and the keys to press are bolded using <b>, </b> tags.

Next the Block Number is defined.  A seven block IAT like in the race IAT example files  is numbered 0-6.

<BlockNumber>0</BlockNumber>

Then the number of trials in the block is determined with a TrialCount tag.  The first three blocks and fifth block of a seven block IAT has 20 trials.

<TrialCount>20</TrialCount>

Finally, the block pairing definition tag determines the order and placement of the stimuli.  The numbers correspond to the category numbers you defined earlier.  The first number’s Category Name appears on the top right of the screen and the second number’s Category Name appears on the top left of the screen, while the stimuli for both categories appear in the center of the screen randomly. It is standard for the two concept categories to appear in the first block.

<BlockPairingDefinition>3,2</BlockPairingDefinition>

At the end of the code for each Block, put a </Block> tag.

For the second block, Block Number 1, we establish the location for the attribute categories. The instructions for this block indicate the location of the attribute Category exemplars. The concept category exemplars and stimuli do not appear in this block.

<Block limitSequence="true">

<Instructions><![CDATA[<font size="16"><p>Put your middle or index fingers on the <b>E</b> and <b>I</b> keys.<br>Words will appear one-by-one in the middle of the screen.<br>Press the <b>E</b> key for <b><font color="#FFFF00">Bad</font></b> words.<br>Press the <b>I</b> key for <b><font color="#FFFF00">Good</font></b> words.<br><br>If you make an error, an <font color="#FF0000"><b>X</b></font> will appear.<br>Fix the error by pressing the other key.<br /><b>GO AS FAST AS YOU CAN</b> and be accurate. </p><br /><p align="center">Press the <b>space bar</b> to begin.</p></font>]]></Instructions>

<BlockNumber>1</BlockNumber>

<TrialCount>20</TrialCount>

<BlockPairingDefinition>0,1</BlockPairingDefinition>

</Block>

Note that the pairing definition corresponds the “Good” and “Bad” attribute category numbers. 
The “0,1” order places the “Good” category name on the top right of the screen and the “Bad” category name on the top left of the screen.

The third block (Block Number 2) is the first critical block.  Though this is technically a “practice” block, the trials will be included in the IAT d-score calculation.  Both attribute and concept stimuli are categorized in the same block.  The instructions indicate the pairings that will be used. The first and third numbers of the pairing definition indicate the category exemplars that will be on the top right of the screen.

<Block limitSequence="true">

<Instructions><![CDATA[<font size="16"><p>Put your middle or index fingers on the <b>E</b> and <b>I</b> keys.<br>Items will appear one-by-one in the middle of the screen.<br>Press the <b>E</b> key for <b><font color="#FFFF00">Bad</font></b> words and faces of <b><font color="#33FF33">Black People</font></b>.<br>Press the <b>I</b> key for <b><font color="#FFFF00">Good</font></b> words and faces of <b><font color="#33FF33">White People</font></b>.<br><br>If you make an error, an <font color="#FF0000"><b>X</b></font> will appear<br>Fix the error by pressing the other key.<br /><b>GO AS FAST AS YOU CAN</b> and be accurate. </p><br /><p align="center">Press the <b>space bar</b> to begin.</p></font>]]></Instructions>

<BlockNumber>2</BlockNumber>

<TrialCount>20</TrialCount>

<BlockPairingDefinition>3,2,0,1</BlockPairingDefinition>

</Block>

The fourth block, Block Number 3, is the longer version of the previous block.  There are 40 trials instead of 20, but the pairing locations are the same.  This means the number order in the Block pairing definition does not change.

The fifth block, or Block Number 4, switches the location of the concept category exemplars. Only the concept category is included in this block so participants can practice the new location. Note the pairing definition is now “2,3” to place the “White People” category name on the top left of the screen and the ”Black People” category name on the top right of the screen. Make sure your instruction text matches these pairings.

<Block limitSequence="true">

<Instructions><![CDATA[<font size="16"><p>LOOK UP. The categories have switched sides.<br>Press the <b>E</b> key for faces of <b><font color="#33FF33">Black People</font></b>.<br>Press the <b>I</b> key for faces of <b><font color="#33FF33">White People</font></b>.<br><br>If you make an error, an <font color="#FF0000"><b>X</b></font> will appear.<br>Fix the error by pressing the other key.<br /><b>GO AS FAST AS YOU CAN</b> and be accurate. </p><br /><p align="center">Press the <b>space bar</b> to begin.</p></font>]]></Instructions>

<BlockNumber>4</BlockNumber>

<TrialCount>20</TrialCount>

<BlockPairingDefinition>2,3</BlockPairingDefinition>

</Block>

The sixth Block, or Block Number 5, includes both the attribute and concept categories now that the concept names have switched sides.  It is a “practice” block similar to the third block (Number 2) so has 20 trials. The pairing definition of “2,3,0,1” places the “Black People” and “Bad” words on the top left of the screen and “White People” and “Good” words on the top right.

<Block limitSequence="true">

<Instructions><![CDATA[<font size="16"><p>Press the <b>E</b> key for <b><font color="#FFFF00">Bad</font></b> words and faces of <b><font color="#33FF33">Black People</font></b>.<br>Press the <b>I</b> key for <b><font color="#FFFF00">Good</font></b> words and faces of <b><font color="#33FF33">White People</font></b>.<br><br>If you make an error, an <font color="#FF0000"><b>X</b></font> will appear.<br>Fix the error by pressing the other key.<br /><b>GO AS FAST AS YOU CAN</b> and be accurate. </p><br /><p align="center">Press the <b>space bar</b> to begin.</p></font>]]></Instructions>

<BlockNumber>5</BlockNumber>

<TrialCount>20</TrialCount>

<BlockPairingDefinition>2,3,0,1</BlockPairingDefinition>

</Block>

The final Block, Block number 6, retains the pairing locations of the previous block, but has twice as many (40) trials.

 

Results

The final part of the file sets what results will appear on the debriefing page according to a rough calculation of the IAT d score automatically performed by the file.  Negative scores indicate a preference for the concept category that first appears on the right side of the screen, or the first category number in the pairing definition for blocks 0, 2, and 3.

 

<Results>

<Result id="0" cutoff="-.65">Your data suggest a strong implicit preference for Black People compared to White People.</Result>

<Result id="1" cutoff="-.35">Your data suggest a moderate implicit preference for Black People compared to White People.</Result>

<Result id="2" cutoff="-.15">Your data suggest a slight implicit preference for Black People compared to White People.</Result>

<Result id="3" cutoff="0">Your data suggest little to no difference in implicit preference between Black People and White People.</Result>

<Result id="4" cutoff=".15">Your data suggest a slight implicit preference for White People compared to Black People.</Result>

<Result id="5" cutoff=".35">Your data suggest a moderate implicit preference for White People compared to Black People.</Result>

<Result id="6" cutoff=".65">Your data suggest a strong implicit preference for White People compared to Black People.</Result>

</Results>

The Report Blocks line indicates what Blocks are included in this calculation.  A seven block IAT reports 2,3,5, and 6, or all the blocks that included both concept and attribute categories.

<ReportBlocks>2,3,5,6</ReportBlocks>

The Final line of the file ends the IAT.

</IAT>

 

IAT versions

Typically, participants are randomly assigned to one of two IATs in any given study.  The order of the concept category placement is different in the two versions.  The iatrace2.xml file has “Good” words and “White People” paired together first, while the iatrace1.xml file has “Good” words and “Black People” paired together first.  The order of the pairing definition and the corresponding instructions differ between the two files, but the category and stimuli code are identical.  Note that the results text for iatrace2.xml is inverted so that negative scores indicate a preference for Black People.

Experiment Files

Participants are randomly assigned to one of the versions to counterbalance the Block order.  You can see the experiment file for a study where participants are assigned to one of the two race IAT versions below. For a description on how to create an experiment file to counterbalance the IATs with multiple conditions within your study, see the [advanced experiment page].

Here is the link to the experiment:

https://pi.psyc.virginia.edu/implicit/showfiles.jsp?user=kschmidt&study=...