**************************************************************************************************************
**************************************************************************************************************
	Implicit Attitude Test (IAT)
**************************************************************************************************************
**************************************************************************************************************
	Last Modified:	05-19-2009 at 09:00 AM (PST)
**************************************************************************************************************
**************************************************************************************************************

***********************************************************************
This sample IAT can be easily adapted to different target categories 
and attributes. To change the categories, you need only change the 
stimulus items and labels immediately below this line.

***********************************************************************

<item attributeAlabel>
/1 = "Supportive"
</item>

<item attributeA>
/1 = "Giving"
/2 = "Nurturing"
/3 = "Warm"
/4 = "Supportive"
/5 = "Caring"
/6 = "Loving"
/7 = "Reassuring"
/8 = "Accepting"
/9 = "Attentive"
/10 = "Approving"
</item>

<item attributeBlabel>
/1 = "Rejecting"
</item>

<item attributeB>
/1 = "Indifferent"
/2 = "Cold"
/3 = "Disapproving"
/4 = "Judgmental"
/5 = "Unaccepting"
/6 = "Detached"
/7 = "Critical"
/8 = "Unfeeling"
/9 = "Uncaring"
/10 = "Rejecting"
</item>

<item targetAlabel>
/ items = getLabelTargetA
</item>

<item targetA>
/ items = getItemsTargetA
</item>

<item targetBlabel>
/ 1 = "Not <% item.targetAlabel.1 %>"
</item>

<item targetB>
/ items = getItemsTargetB
</item>

<item getLabelTargetAInstructions>
/ 1 = "Please enter the name of your romantic partner"
</item>


***********************************************************************
To change the categories, you need only change the stimulus items and 
labels immediately above this line. All commands below relate to the 
IAT procedure, and need only be changed if you wish to modify the 
generic IAT procedure.
***********************************************************************


***********************************************************************
Performance summary
***********************************************************************

<trial summary>
/ stimulustimes = [0=summary]
/ validresponse = (" ")
/ recorddata = false
/ ontrialbegin = [values.magnitude = "little to no"]
/ ontrialbegin = [if( abs(expressions.d) > 0.15 ) values.magnitude = "a slight"]
/ ontrialbegin = [if( abs(expressions.d) > 0.35 ) values.magnitude = "a moderate"]
/ ontrialbegin = [if( abs(expressions.d) >= 0.65 ) values.magnitude = "a strong"]/ ontrialbegin = [if (expressions.d >= 0) expressions.preferred = item.targetALabel.1]
/ ontrialbegin = [if (expressions.d < 0.0) expressions.preferred = item.targetBLabel.1]
/ ontrialbegin = [if (expressions.d < 0.0) expressions.notpreferred= item.targetALabel.1]
/ ontrialbegin = [if (expressions.d >= 0.0) expressions.notpreferred= item.targetBLabel.1]
</trial>

<text summary>
/ items = ("Your IAT score (D) was <% expressions.d %>, which suggests <% values.magnitude %> automatic preference for <% expressions.preferred %> compared to <% expressions.notpreferred %>.~n~n~nPress the spacebar to complete this session.") 
/ size = (60%, 60%)
/ hjustify = left
 </text>

***********************************************************************
Task instruction stimuli
***********************************************************************

<trial instructions>
/ stimulustimes = [1=instructions, spacebar]
/ correctresponse = (" ")
/ errormessage = false
/ recorddata = false
</trial>

<text instructions>
/ items = instructions
/ hjustify = left
/ size = (90%, 60%)
/ position = (50%, 85%)
/ valign = bottom
/ select = sequence
/ resetinterval = 20
</text>

<item instructions>
/ 1 = "Put your middle or index fingers on the E and I keys of your keyboard. Words representing the categories at the top will appear one-by-one in the middle of the screen. When the item belongs to a category on the left, press the E key; when the item belongs to a category on the right, press the I key. Items belong to only one category. If you make an error, an X will appear - fix the error by hitting the other key.

This is a timed sorting task. GO AS FAST AS YOU CAN while making as few mistakes as possible. Going too slow or making too many errors will result in an uninterpretable score. This task will take about 5 minutes to complete."
/ 2 = "See above, the categories have changed. The items for sorting have changed as well. The rules, however, are the same.

When the item belongs to a category on the left, press the E key; when the item belongs to a category on the right, press the I key. Items belong to only one category. An X appears after an error - fix the error by hitting the other key. GO AS FAST AS YOU CAN."
/ 3 = "See above, the four categories you saw separately now appear together. Remember, each item belongs to only one group. For example, if the categories flower and good appeared on the separate sides above - words meaning flower would go in the flower category, not the good category.

The green and white labels and items may help to identify the appropriate category. Use the E and I keys to categorize items into four groups left and right, and correct errors by hitting the other key."

/ 4 = "Sort the same four categories again. Remember to go as fast as you can while making as few mistakes as possible.

The green and white labels and items may help to identify the appropriate category. Use the E and I keys to categorize items into the four groups left and right, and correct errors by hitting the other key."
/ 5 = "Notice above, there are only two cateogries and they have switched positions. The concept that was previously on the left is now on the right, and the concept that was on the right is now on the left. Practice this new configuration.

Use the E and I keys to catgorize items left and right, and correct errors by hitting the other key."
/ 6 = "See above, the four categories now appear together in a new configuration. Remember, each item belongs to only one group.

The green and white labels and items may help to identify the appropriate category. Use the E and I keys to categorize items into the four groups left and right, and correct errors by hitting the other key."
/ 7 = "Sort the same four categories again. Remember to go as fast as you can while making as few mistakes as possible.

The green and white labels and items may help to identify the appropriate category. Use the E and I keys to categorize items into the four groups left and right, and correct errors by hitting the other key."
</item>

<item getItemsTargetInstructions>
/ 1 = "Think of something that fits this category and enter it below. Do not to enter any items that you have already entered."
</item>

<text spacebar>
/ items = ("Press the SPACE BAR to begin.")
/ position = (50%, 95%)
/ valign = bottom
</text>

<text attributeA>
/ items = attributeA
/ fontstyle = ("Arial", 5%)
/ txcolor = (0, 255, 0)
</text>

<text attributeB>
/ items = attributeB
/ fontstyle = ("Arial", 5%)
/ txcolor = (0, 255, 0)
</text>

<text targetB>
/ items = targetB
/ fontstyle = ("Arial", 5%)
</text>

<text targetA>
/ items = targetA
/ fontstyle = ("Arial", 5%)
</text>

<text error>
/ position = (50%, 75%)
/ items = ("X")
/ color = (255, 0, 0)
/ fontstyle = ("Arial", 10%, true)
</text>

<text attributeAleft>
/ items = attributeAlabel
/ valign = top
/ halign = left
/ position = (5%, 5%)
/ txcolor = (0, 255, 0)
/ fontstyle = ("Arial", 5%)
</text>

<text attributeBright>
/ items = attributeBlabel
/ valign = top
/ halign = right
/ position = (95%, 5%)
/ txcolor = (0, 255, 0)
/ fontstyle = ("Arial", 5%)
</text>

<text attributeAleftmixed>
/ items = attributeAlabel
/ valign = top
/ halign = left
/ position = (5%, 19%)
/ txcolor = (0, 255, 0)
/ fontstyle = ("Arial", 5%)
</text>

<text attributeBrightmixed>
/ items = attributeBlabel
/ valign = top
/ halign = right
/ position = (95%, 19%)
/ txcolor = (0, 255, 0)
/ fontstyle = ("Arial", 5%)
</text>

<text targetBleft>
/ items = targetBlabel
/ valign = top
/ halign = left	
/ position = (5%, 5%)
/ fontstyle = ("Arial", 5%)
</text>

<text targetBright>
/ items = targetBlabel
/ valign = top
/ halign = right
/ position = (95%, 5%)
/ fontstyle = ("Arial", 5%)
</text>

<text targetAleft>
/ items = targetAlabel
/ valign = top
/ halign = left
/ position = (5%, 5%)
/ fontstyle = ("Arial", 5%)
</text>

<text targetAright>
/ items = targetAlabel
/ valign = top
/ halign = right
/ position = (95%, 5%)
/ fontstyle = ("Arial", 5%)
</text>

<text orleft>
/ items = ("or")
/ valign = top
/ halign = left
/ position = (5%, 12%)
/ fontstyle = ("Arial", 5%)
</text>

<text orright>
/ items = ("or")
/ valign = top
/ halign = right
/ position = (95%, 12%)
/ fontstyle = ("Arial", 5%)
</text>

<text getItemsTargetALabel>
/ items = targetALabel
/ position = (50%, 40%)
/ valign = bottom
/ fontstyle = ("Arial", 3%)
/ txcolor = (0, 255, 0)
</text>

<text getItemsTargetBLabel>
/ items = targetBLabel
/ position = (50%, 40%)
/ valign = bottom
/ fontstyle = ("Arial", 3%)
/ txcolor = (0, 255, 0)
</text>

<text getItemsTargetInstructions>
/ items = getItemsTargetInstructions
/ position = (50%, 40%)
/ valign = top
/ fontstyle = ("Arial", 3%)
/ size = (66%, 33%)
</text>

<text getLabelTargetAInstructions>
/ items = getLabelTargetAInstructions
/ position = (50%, 40%)
/ valign = top
/ fontstyle = ("Arial", 3%)
/ size = (66%, 33%)
</text>


***********************************************************************
Trials for gathering items
***********************************************************************

<openended getItemsTargetA>
/ stimulusframes = [1=getItemsTargetALabel, getItemsTargetInstructions]
/ charlimit = 25
/ size = (25%, 4%)
/ position = (50%, 60%)
/ fontstyle = ("Arial", 3%)
</openended>

<openended getItemsTargetB>
/ stimulusframes = [1=getItemsTargetBLabel, getItemsTargetInstructions]
/ charlimit = 25
/ size = (25%, 4%)
/ position = (50%, 60%)
/ fontstyle = ("Arial", 3%)
</openended>

***********************************************************************
Trials for gathering labels
***********************************************************************

<openended getLabelTargetA>
/ stimulusframes = [1=getLabelTargetAInstructions]
/ charlimit = 25
/ size = (25%, 4%)
/ position = (50%, 60%)
/ fontstyle = ("Arial", 3%)
</openended>


***********************************************************************
IAT Trials
***********************************************************************


<trial attributeA>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = attributeA]
/ posttrialpause = 250
</trial>

<trial attributeB>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = attributeB]
/ posttrialpause = 250
</trial>


<trial targetBleft>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = targetB]
/ posttrialpause = 250
</trial>

<trial targetBright>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = targetB]
/ posttrialpause = 250
</trial>

<trial targetAleft>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = targetA]
/ posttrialpause = 250
</trial>

<trial targetAright>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = targetA]
/ posttrialpause = 250
</trial>

***********************************************************************
Blocks
***********************************************************************

<block getTargetItems>
/ trials = [1=getLabelTargetA;2-6=getItemsTargetA;7-11=getItemsTargetB]
</block>

<block attributepractice>
/ bgstim = (attributeAleft, attributeBright)
/ trials = [1=instructions;2-21 = random(attributeA, attributeB)]
/ errormessage = true(error,200)
/ responsemode = correct
</block>

<block targetcompatiblepractice>
/ bgstim = (targetAleft, targetBright)
/ trials = [1=instructions;2-21 = random(targetAleft, targetBright)]
/ errormessage = true(error,200)
/ responsemode = correct
</block>

<block targetincompatiblepractice>
/ bgstim = (targetAright, targetBleft)
/ trials = [1=instructions;2-21 = random(targetAright, targetBleft)]
/ errormessage = true(error,200)
/ responsemode = correct
</block>

<block targetcompatiblepracticeswitch>
/ bgstim = (targetAleft, targetBright)
/ trials = [1=instructions;2-41 = random(targetAleft, targetBright)]
/ errormessage = true(error,200)
/ responsemode = correct
</block>

<block targetincompatiblepracticeswitch>
/ bgstim = (targetAright, targetBleft)
/ trials = [1=instructions;2-41 = random(targetAright, targetBleft)]
/ errormessage = true(error,200)
/ responsemode = correct
</block>

<block compatibletest1>
/ bgstim = (targetAleft, orleft, attributeAleftmixed, targetBright, orright, attributeBrightmixed)
/ trials = [1=instructions;
  3,5,7,9,11,13,15,17,19,21= random(targetAleft, targetBright);
  2,4,6,8,10,12,14,16,18,20 = random(attributeA, attributeB)]
/ errormessage = true(error,200)
/ responsemode = correct
/ ontrialend = [if (block.compatibletest1.latency  <= 10000 && block.compatibletest1.currenttrialnumber != 1) values.sum1a =  values.sum1a + block.compatibletest1.latency]
/ ontrialend = [if (block.compatibletest1.latency  <= 10000 && block.compatibletest1.currenttrialnumber != 1) values.n1a =  values.n1a + 1]
/ ontrialend = [if (block.compatibletest1.latency  <= 10000 && block.compatibletest1.currenttrialnumber != 1) values.ss1a =  values.ss1a + (block.compatibletest1.latency * block.compatibletest1.latency)]
</block>

<block compatibletest2>
/ bgstim = (targetAleft, orleft, attributeAleftmixed, targetBright, orright, attributeBrightmixed)
/ trials = [
  2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40 = random(targetAleft, targetBright);
  1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39 = random(attributeA, attributeB)]
/ errormessage = true(error,200)
/ responsemode = correct
/ ontrialend = [if (block.compatibletest2.latency  <= 10000) values.sum1b =  values.sum1b + block.compatibletest2.latency]
/ ontrialend = [if (block.compatibletest2.latency  <= 10000) values.n1b =  values.n1b + 1]
/ ontrialend = [if (block.compatibletest2.latency  <= 10000) values.ss1b =  values.ss1b + (block.compatibletest2.latency * block.compatibletest2.latency)]
</block>

<block incompatibletest1>
/ bgstim = (targetBleft, orleft, attributeAleftmixed, targetAright, orright, attributeBrightmixed)
/ trials = [1=instructions;
  3,5,7,9,11,13,15,17,19,21 = random(targetBleft, targetAright);
  2,4,6,8,10,12,14,16,18,20 = random(attributeA, attributeB)]
/ errormessage = true(error,200)
/ responsemode = correct
/ ontrialend = [if (block.incompatibletest1.latency  <= 10000 && block.incompatibletest1.currenttrialnumber != 1) values.sum2a =  values.sum2a + block.incompatibletest1.latency]
/ ontrialend = [if (block.incompatibletest1.latency  <= 10000 && block.incompatibletest1.currenttrialnumber != 1) values.n2a =  values.n2a + 1]
/ ontrialend = [if (block.incompatibletest1.latency  <= 10000 && block.incompatibletest1.currenttrialnumber != 1) values.ss2a =  values.ss2a + (block.incompatibletest1.latency * block.incompatibletest1.latency)]
</block>

<block incompatibletest2>
/ bgstim = (targetBleft, orleft, attributeAleftmixed, targetAright, orright, attributeBrightmixed)
/ trials = [
  2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40 = random(targetBleft, targetAright);
  1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39 = random(attributeA, attributeB)]
/ errormessage = true(error,200)
/ responsemode = correct
/ ontrialend = [if (block.incompatibletest2.latency  <= 10000) values.sum2b =  values.sum2b + block.incompatibletest2.latency]
/ ontrialend = [if (block.incompatibletest2.latency  <= 10000) values.n2b =  values.n2b + 1]
/ ontrialend = [if (block.incompatibletest2.latency  <= 10000) values.ss2b =  values.ss2b + (block.incompatibletest2.latency * block.incompatibletest2.latency)]
</block>

<block compatibletestinstructions>
/ bgstim = (targetAleft, orleft, attributeAleftmixed, targetBright, orright, attributeBrightmixed)
/ trials = [1=instructions]
/ recorddata = false
</block>

<block incompatibletestinstructions>
/ bgstim = (targetBleft, orleft, attributeAleftmixed, targetAright, orright, attributeBrightmixed)
/ trials = [1=instructions]
/ recorddata = false
</block>

<block summary>
/ trials = [1=summary]
/ recorddata = false
</block>

***********************************************************************
Experiment
***********************************************************************

<defaults>
/ fontstyle = ("Arial", 3.5%)
/ screencolor = (0,0,0)
/ txbgcolor = (0,0,0)
/ txcolor = (255, 255, 255)
/ minimumversion = "3.0.0.0"
</defaults>

<expt>
/ blocks = [1=getTargetItems; 2=block2; 3=attributepractice; 4=block3; 5=block4; 6=block5; 7=block6; 8=block7; 9=block8; 10=block9]
</expt>

<variables>
/ group = (1 of 2) (block2=targetcompatiblepractice; block3=compatibletest1; block4=compatibletestinstructions; block5=compatibletest2; block6=targetincompatiblepractice; block7=incompatibletest1; block8=incompatibletestinstructions; block9=incompatibletest2)
/ group = (2 of 2) (block2=targetincompatiblepractice; block3=incompatibletest1; block4=incompatibletestinstructions; block5=incompatibletest2; block6=targetcompatiblepractice; block7=compatibletest1; block8=compatibletestinstructions; block9=compatibletest2)
</variables>

***********************************************************************
Data Columns
***********************************************************************

<data>
/ columns = [date, time, subject, blockcode, blocknum, trialcode, trialnum, response, correct, latency, stimulusnumber, stimulusitem, expressions.da, expressions.db, expressions.d ]
</data>

***********************************************************************
Test Monkey
***********************************************************************
<monkey>
/ latencydistribution = normal(500, 100)
/ percentcorrect = 90
</monkey>

***********************************************************************
Scoring
***********************************************************************
<values>
/ sum1a = 0
/ sum2a = 0
/ sum1b = 0
/ sum2b = 0
/ n1a = 0
/ n2a = 0
/ n1b = 0
/ n2b = 0
/ ss1a = 0
/ ss2a = 0
/ ss1b = 0
/ ss2b = 0
/ magnitude = "unknown"
</values>

* 1 is compatible, 2 is incompatible
* a is first block, b is second block

<expressions>
/ m1a = values.sum1a / values.n1a
/ m2a = values.sum2a / values.n2a
/ m1b = values.sum1b / values.n1b
/ m2b = values.sum2b / values.n2b
/ sd1a = sqrt((values.ss1a - (values.n1a * (expressions.m1a * expressions.m1a))) / (values.n1a - 1))
/ sd2a = sqrt((values.ss2a - (values.n2a * (expressions.m2a * expressions.m2a))) / (values.n2a - 1))
/ sd1b = sqrt((values.ss1b - (values.n1b * (expressions.m1b * expressions.m1b))) / (values.n1b - 1))
/ sd2b = sqrt((values.ss2b - (values.n2b * (expressions.m2b * expressions.m2b))) / (values.n2b - 1))
/ sda = sqrt((((values.n1a - 1) * (expressions.sd1a * expressions.sd1a) + (values.n2a - 1) * (expressions.sd2a * expressions.sd2a)) + ((values.n1a + values.n2a) * ((expressions.m1a - expressions.m2a) * (expressions.m1a - expressions.m2a)) / 4) ) / (values.n1a + values.n2a - 1) )
/ sdb = sqrt((((values.n1b - 1) * (expressions.sd1b * expressions.sd1b) + (values.n2b - 1) * (expressions.sd2b * expressions.sd2b)) + ((values.n1b + values.n2b) * ((expressions.m1b - expressions.m2b) * (expressions.m1b - expressions.m2b)) / 4) ) / (values.n1b + values.n2b - 1) )
/ da = (m2a - m1a) / expressions.sda
/ db = (m2b - m1b) / expressions.sdb
/ d = (expressions.da + expressions.db) / 2
/ preferred = "unknown"
/ notpreferred = "unknown"
</expressions>













 
