For an easier way to customize your IAT, click here.

Current version: 1.4 ()

To set up an IAT task for your survey, the first step is to download and unzip one of the following zip files. For an IAT compatible with Bill’s survey script, download this zip file. For an IAT compatible with my survey form template, download this zip file. This file contains a survey page (“page1.html”), which should be inserted into the same file directory as the rest of your survey pages. Please note that if you wish to include the IAT later on in the survey, you can safely rename “page1.html” to something else (e.g., “page3.html”); it won’t break anything.

Disclaimer: Javascript has a couple fundamental limitations with how it runs timed events. First, its internal clock can be off by about +/-15ms in some browsers (info). In addition, the processing speed of computers may cause events to take longer than they should (i.e. a 20ms prime may take 25ms instead). I have created a list of a few methods to compensate for these problems.

Output

When participants complete the task, the output will consist of nine numbers for each one:

  1. The average response time of the first critical block (by default, Block 3)
  2. The standard deviation of correct responses in the first critical block
  3. The error rate (proportion incorrect) of the first critical block
  4. The average response time of the second critical block (by default, Block 5)
  5. The standard deviation of correct responses in the second critical block
  6. The error rate (proportion incorrect) of the second critical block
  7. The difference between the average response times of the two critical blocks: (Block 3 − Block 5)
  8. The standard deviation of response times for all correct responses in the two critical blocks
  9. The average error rate of the two critical blocks: (proportion incorrect for Block 3 + proportion incorrect for Block 5) / 2
If, for some reason, you need more than just these values, email me (Jeff Hughes) and I can probably work something out.

Customization

In order to customize the IAT task itself, you need to open “page1.html” in a text editor like Notepad, Wordpad, or my personal preference, Notepad++ (which should be available on school computers, and is also free to download). All the details about the IAT task are stored in variables, which I have tried to make as easy to edit as possible.

General Details

Near the top of the file (starting at line 35) are a few variables: var delay = 300; // delay between words/images, in milliseconds var upperLimit = 3000; // response times slower than this value (in milliseconds) will be set to this value var lowerLimit = 300; // response times quicker than this value (in milliseconds) will be set to this value var criticalBlock1 = 3; // first critical block of items; in most cases this value should be 3 var criticalBlock2 = 5; // second critical block of items; response time average from this block will be subtracted from that of criticalBlock1 // in most cases this value should be 5 Be sure that you only change what is in between the equals sign and the semi-colon (or what is highlighted red above). The text after the double-slash (//) gives a bit more detail about what each variable does. Generally, most of these variables should not need to be edited, but they’re there if you want to.

IAT Blocks

The standard IAT is made up of five blocks, or sets of items, with the critical blocks being blocks 3 and 5. In the file, each block starts off like so: /* ------------- BLOCK 1 ------------- */ The blocks have four variables: the instructions for that block, the labels for left and right (e.g, “Like” and “Don’t like”), the words/images that have “left” as the correct answer, and the words/images that have “right” as the correct answer. Each variable has the block number (1-5) listed in square brackets after its name.

As you can see, here are the instructions for block 1: instructions[1] = "The following screens will ask you to distinguish between things that most people in North America might like or dislike.<br><br>\ Press the 'a' key if the stimulus corresponds with the category MOST PEOPLE DON'T LIKE.<br>\ Press the 'k' key if the stimulus corresponds with the category MOST PEOPLE LIKE.<br><br>\ Please place your hands on the keyboard now, so that you can press the 'a' key with your left hand, and the 'k' key with your right hand.<br><br>\ Make sure that your hands are positioned correctly because only 'a' and 'k' will be recognized by the program.<br><br>\ GO FAST but please select the answer you want."; These can be edited as you please, but with three things to keep in mind.

  1. Line breaks that will be visible to the participant are created with this: <br>
  2. If you want to make the instructions go onto multiple lines to make it easier for yourself to read (this will not be visible to participants), you MUST end the line with a backslash (\). Make sure it’s the absolute last thing on the line—not even any spaces afterwards! Failure to do this will mess everything up…it won’t be pretty.
  3. If you want to use double quotes, "like so", you need to “escape” each double quote with a backslash in front of it, \"like so\". This is because the instructions themselves are inside double quotes, so putting more double quotes makes Javascript think that the instructions have ended.

Following the instructions are the labels for left and right: labels[1] = ["Most people don't like", "Most people like"]; // left, right Edit the code highlighted in red to your heart’s desire, but keep everything else how it is or risk catastrophe.

Finally, we come to the spot to edit the words/images in each trial. They are separated into left and right, which identify the correct response as shown by the labels right above. When presented to participants, both left and right words will be collected together and presented in random order. Here is an example of the code for “left” words in block 1: words_left[1] = [ "disease", "abuse", "garbage", "death", "agony", "pain", "evil", "vomit", "disaster", "stink" ]; Please don’t associate the above words with my script! Each word should be in double quotes, and should be separated with commas (no comma needed at the end). If you wish to add more words, just add a comma to the last item and add some more. Again, they will be presented in random order, so the order of the list is not important.

The process for adding images is very similar: words_left[2] = [ "https://artsresearch.uwaterloo.ca/~username/studyname/images/white1.jpg", "https://artsresearch.uwaterloo.ca/~username/studyname/images/white2.jpg", "https://artsresearch.uwaterloo.ca/~username/studyname/images/white3.jpg", "https://artsresearch.uwaterloo.ca/~username/studyname/images/white4.jpg", "https://artsresearch.uwaterloo.ca/~username/studyname/images/white1.jpg", "https://artsresearch.uwaterloo.ca/~username/studyname/images/white2.jpg", "https://artsresearch.uwaterloo.ca/~username/studyname/images/white3.jpg", "https://artsresearch.uwaterloo.ca/~username/studyname/images/white4.jpg" ]; You should upload the images somewhere onto your artsresearch account, and then insert the full URL (including the “http” at the beginning). If you are running your survey on a secure server, change the URL you insert from “http” to “https” to make sure that participants don’t get strange error messages.

Note that in the above code, each image URL is listed twice. This just makes each image appear twice. If you want the same image shown ten times, just copy and paste it in there ten times. It’s up to you.

After you’ve edited the code for block 1, try it again with block 2. Then block 3. Then blocks 4 and 5. Then go treat yourself to a nice cold beer. You deserve it after all that editing.

Once you have the items customized the way you wish, run Bill’s script or my script like you would normally do for surveys. Participants will now be able to complete your IAT; with output for each one.

That’s it! Good luck, and be sure to implicitly associate my script with positive, happy thoughts!