Millisecond Forums

## Stroop Task balancing/ordering

https://forums.millisecond.com/Topic8642.aspx

 By zzril - 9/5/2012 I am creating a Stroop Task and would like to balance the presentation of stimuli such that there are equal number of congruent and incongruent trials. Additionally, I'd like to be able to display each of the four colors an equal number of times and randomly order the presentation so that combinations which have been presented previously will have a lower probability of being presented again. In lieu of this, is there any way to prevent identical stimuli from being presented consecutively? Any assistance would be greatly appreciated. By Dave - 9/6/2012 is there any way to prevent identical stimuli from being presented consecutivelSee the documentation for the replacenorepeat and noreplacenorepeat selection modes.I am creating a Stroop Task and would like to balance the presentation of stimuli such that there are equal number of congruent and incongruent trials. Additionally, I'd like to be able to display each of the four colors an equal number of times and randomly order the presentation so that combinations which have been presented previously will have a lower probability of being presented again.See e.g. the Food Stroop script available from the Task Library for a possible approach. In short, you'll want to set up elements encoding your stimulus / feature combinations and sample from those combinations.Regards,~Dave By zzril - 9/10/2012 So I was able to adapt the Food Stroop, but still am unable to get it to balance my congruent and incongruent trials. I know it has something to do with the noreplace statement, but I'm not savvy enough to use it correctly. I also wanted to present a series of XXXX instead of a color word as a neutral stimulus, but can't seem to get it to display. On my test run of 20 trials, I'm getting the following patterns:RED = 1 congruent color, 5 incongruent colorYELLOW = 1 cc, 0 icGREEN = 3 cc, 4 icBLUE = 0 cc, 6 icXXXX = nothingI know there must be something that is glaringly obvious, but I'm not seeing it. Here's the script:**************************************************************************************************************************************************************************************************************VOICE RECOGNITION FOUR COLOR STROOP TASK*********************************************************************************************************************************************************************************************************************************************************************DEFAULTS*******************************************************/ fontstyle = ("Verdana", 6.00%, true)/ screencolor = (white)/ txbgcolor = (white)/ inputdevice = voicerecord/ voicekeythreshold = 50/ posttrialpause = 500***************************************************************************************************************Values***************************************************************************************************************Notes:*'values.stimcolor' contains a numeric representation of the current word's display color:*1=blue, 2=green, 3=red, 4=yellow*'values.condition' contains a numeric representation of the current condition:*1=congruent, 2=incongruent/ stimcolor = 0/ stimword = ""/ condition = 0*******************************************************TRIALS******************************************************************************************Instruction Trial**********************************/ stimulustimes = [0=instructions, navigation;500=example01,example02 ]/ inputdevice = keyboard/ validresponse = (57)/ recorddata = false***********************************Practice Trial**********************************/ ontrialbegin = [values.stimcolor=counter.practicecolors.selectedvalue]/ ontrialbegin = [text.stimword.textcolor=getitem(counter.stimcolor,values.stimcolor)]/ ontrialbegin = [values.stimword=counter.practicewords.selectedvalue]/ stimulustimes = [0=fixation;200=stimword]******************Color trials******************Congruent/ ontrialbegin = [values.stimcolor=counter.cdcc.selectedvalue]/ ontrialbegin = [text.stimword.textcolor=getitem(counter.stimcolor, values.stimcolor)]/ ontrialbegin = [values.stimword=getitem(item.colorwords, counter.cwcc.selectedvalue)]/ stimulustimes = [0=fixation;200=stimword]*Incongruent/ ontrialbegin = [values.stimcolor=counter.cdic.selectedvalue]/ ontrialbegin = [text.stimword.textcolor=getitem(counter.stimcolor, values.stimcolor)]/ ontrialbegin = [values.stimword=getitem(item.colorwords, counter.cwic.selectedvalue)]/ stimulustimes = [0=fixation;200=stimword]*******************************************************BLOCKS*******************************************************/ trials = [1-5=practicetrial]/ bgstim = (whitebg)/ trials = [1-3=instructiontrial]/ bgstim = (whitebg)/ trials = [1=instructiontrial]/ bgstim = (whitebg)/ trials = [1=instructiontrial]/ onblockbegin = [values.condition=1]/ trials = [1-10=CCtrial]/ onblockbegin = [values.condition=2]/ trials = [1-10=ICtrial]*******************************************************EXPERIMENT*******************************************************/ blocks = [1=instructions01; 2=practiceblock; 3=instructions02;    4-5=noreplacenorepeat(CC,IC);    6=instructions03]***************************************************************************************************************Stimulus Elements**************************************************************************************************************/ items = ("<%values.stimword%>")/ txcolor = (white)/ items = ("+")/ txcolor = (black)/ shape = rectangle/ color = white/ erase = false/ size = (87.5%, 87.5%)**************************************************************************************************************Counter Elements / Selection Logic***************************************************************************************************************Practice Items**************************************/ items = ("GREEN", "RED", "BLUE", "YELLOW", "XXXX")/ select = current(practicecolors)/ items = (3,4,1,2)/ select = sequence***************************************Counter Elements / Selection Logic for Test Block**************************************/ items = (blue, green, red, yellow)/ select = values.stimcolor***************************************************************************************************************Congruent Color (CC)***************************************Display**************************************/ items = (1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)/ select = noreplacenorepeat/ selectionrate = trial***************************************Word**************************************/ items = (1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)/ select = current(cdcc)/ selectionrate = trial***************************************Incongruent Color (IC)***************************************Display**************************************/ items = (2,3,4,1,3,4,1,2,4,1,2,3,1,2,3,4)/ select = noreplacenorepeat/ selectionrate = trial***************************************Word**************************************/ items = (1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)/ select = current(cdic)/ selectionrate = trial**************************************/1 ="         RED         "/2 ="        GREEN        "/3 ="        BLUE         "/4 ="       YELLOW        "/5="         XXXX         "**************************************************************************INSTRUCTIONS*******************************************************/ items = instructions/ select = sequence/ size = (85%, 85%)/ txbgcolor = (transparent)/ fontstyle = ("Verdana", 3.00%, true)/ erase = false/ resetinterval = 0/ 1 = "~rYou will see a series of words displayed in different colors.Name aloud the color of the presented word - red, yellow, green, blue - as quickly and as accurately as possible.  If you make a mistake, keep going."/ 2 = "~rYou will see a series of words displayed in different colors.Name aloud the color of the presented word - red, yellow, green, blue - as quickly and as accurately as possible.  If you make a mistake, keep going.~rFor example, when this word appears,~r~r~ryou would respond with ''red'' as quickly as possible."/ 3 = "~rYou will see a series of words displayed in different colors.Name aloud the color of the presented word - red, yellow, green, blue - as quickly and as accurately as possible.  If you make a mistake, keep going.~rFor example, when this word appears,~r~r~ryou would respond with ''red'' as quickly as possible.~rIf this word appears,~r~r~ryou would respond with ''blue'' as quickly as possible. ~rLet's practice a few words before we begin."/ 4 = "~r~r~r~r~r~rIf you have any questions, please ask the study coordinator.~rWhen you are ready to begin, press the SPACE BAR."/ 5 = "~r~r~r~r~r~rPlease let the study coordinator know you have finished."/ items = example01/ select = sequence/ resetinterval = 0/ txcolor = (red)/ txbgcolor = (transparent)/ position = (50%, 41%)/ erase = false/ 1 = " "/ 2 = "YELLOW"/ 3 = "YELLOW"/ 4 = " "/ items = example02/ select = sequence/ resetinterval = 0/ position = (50%, 63%)/ txcolor = (blue)/ txbgcolor = (transparent)/ erase = false/ 1 = " "/ 2 = " "/ 3 = "GREEN"/ 4 = " "/ 5 = " "/ items = navigation/ select = sequence/ resetinterval = 0/ fontstyle = ("Verdana", 3.00%, true)/ txbgcolor = (white)/ size = (87.5%, 5%)/ position = (50%, 90%)/ erase = false/ 1 = "Press the SPACEBAR to continue."/ 2 = "Press the SPACEBAR to continue."/ 3 = "Press the SPACE BAR when you are ready to begin."/ 4 = " "/ 5 = " " By Dave - 9/10/2012 Looking only at the two dependent counters below,/ items = (1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)/ select = noreplacenorepeat/ selectionrate = trial/ items = (1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)/ select = current(cdcc)/ selectionrate = trialit should be obvious that things won't work. They contain different numbers of items (16 in cdcc, 25 in cwcc).I recommend you give the threads I referred you to earlier another look. EDIT: My bad. I hadn't mentioned any other thread. Here goes, my apologies:E.g. http://www.millisecond.com/forums/Topic2270.aspxRegards,~Dave By zzril - 9/10/2012 The counter is what is confusing me and I'm still unclear how to get it to display "XXXX" in each of the colors. By Dave - 9/10/2012 I recommend youTake out paper and pencil. Make a table. In the 1st column, write down the display color of the stimulus.In the 2nd column, write down the stimulus word.Repeat until you have all desired combinations listed in the desired amount.Encode those combinations in elements. You need one per column.-----------------------------------       Congruent Trials-----------------------------------[#] [Display Color] [Stimulus Word]-----------------------------------1   BLUE            BLUE2   GREEN           GREEN3   RED             RED4   YELLOW          YELLOW5   BLUE            BLUE6   GREEN           GREEN7   RED             RED...-----------------------------------      Incongruent Trials-----------------------------------[#] [Display Color] [Stimulus Word]-----------------------------------1   BLUE            GREEN2   BLUE            RED3   BLUE            YELLOW4   GREEN           BLUE5   GREEN           RED6   GREEN           YELLOW...Etc.Regards,~Dave By zzril - 9/11/2012 So I'm still having no luck getting the XXXX text to display. I've taken the syntax for the Food Stroop and just replaced the congruent color trial with an XXXX trial and it crashes every time. I didn't change the counter values at all, so don't really know what I'm doing wrong.**************************************************************************************************************************************************************************************************************VOICE RECOGNITION FOUR COLOR STROOP TASK*****************************************************************************************************************************************************************************************************************************************************************************************************************************DEFAULTS**************************************************************************************************************/ fontstyle = ("Verdana", 6.00%, true)/ screencolor = (white)/ txbgcolor = (white)/ inputdevice = voicerecord/ voicekeythreshold = 50/ posttrialpause = 500***************************************************************************************************************Values***************************************************************************************************************Notes:*'values.stimcolor' contains a numeric representation of the current word's display color:*1=blue, 2=green, 3=red, 4=yellow*'values.condition' contains a numeric representation of the current condition:*1=incongruent, 2=XXXX/ stimcolor = 0/ stimword = ""/ condition = 0***************************************************************************************************************Custom Data Output**************************************************************************************************************/ columns = [date,time,subject,blocknum,blockcode,trialnum,trialcode,latency,response,    values.stimword,values.stimcolor,values.condition]/ separatefiles = true***************************************************************************************************************TRIALS*************************************************************************************************************************************************Instruction Trial**********************************/ stimulustimes = [0=instructions, navigation;500=example01,example02 ]/ inputdevice = keyboard/ validresponse = (57)/ recorddata = false***********************************Practice Trial**********************************/ ontrialbegin = [values.stimcolor=counter.practicecolors.selectedvalue]/ ontrialbegin = [text.stimword.textcolor=getitem(counter.stimcolor,values.stimcolor)]/ ontrialbegin = [values.stimword=counter.practicewords.selectedvalue]/ stimulustimes = [0=fixation;250=stimword]******************Color trials******************Incongruent/ ontrialbegin = [values.stimcolor=counter.cdic.selectedvalue]/ ontrialbegin = [text.stimword.textcolor=getitem(counter.stimcolor, values.stimcolor)]/ ontrialbegin = [values.stimword=getitem(item.colorwords, counter.cwic.selectedvalue)]/ stimulustimes = [0=fixation;250=stimword]*XXXX/ ontrialbegin = [values.stimcolor=counter.cdic.selectedvalue]/ ontrialbegin = [text.stimword.textcolor=getitem(counter.stimcolor, values.stimcolor)]/ ontrialbegin = [values.stimword=getitem(item.colorwords, counter.cwxx.selectedvalue)]/ stimulustimes = [0=fixation;250=stimword]***************************************************************************************************************BLOCKS**************************************************************************************************************/ trials = [1-5=practicetrial]/ bgstim = (whitebg)/ trials = [1-3=instructiontrial]/ bgstim = (whitebg)/ trials = [1=instructiontrial]/ bgstim = (whitebg)/ trials = [1=instructiontrial]/ onblockbegin = [values.condition=1]/ trials = [1-20=ICtrial]/ onblockbegin = [values.condition=2]/ trials = [1-20=XXtrial]*******************************************************EXPERIMENT*******************************************************/ blocks = [1=instructions01; 2=practiceblock; 3=instructions02;    4-5=noreplacenorepeat(IC, XX);    6=instructions03]***************************************************************************************************************Stimulus Elements**************************************************************************************************************/ items = ("<%values.stimword%>")/ txcolor = (white)/ items = ("+")/ txcolor = (black)/ shape = rectangle/ color = white/ erase = false/ size = (87.5%, 87.5%)**************************************************************************************************************Counter Elements / Selection Logic***************************************************************************************************************Practice Items**************************************/ items = ("GREEN", "RED", "BLUE", "YELLOW", "XXXX")/ select = current(practicecolors)/ items = (3,4,5,1,2)/ select = sequence***************************************Counter Elements / Selection Logic for Test Block**************************************/ items = (blue, green, red, yellow)/ select = values.stimcolor*****************************************************************************************************************************************************Incongruent Color (IC)***************************************Display**************************************/ items = (2,3,4,5,1,3,4,5,1,2,4,5,1,2,3,5,1,2,3,4)/ select = noreplacenorepeat/ selectionrate = trial***************************************Word**************************************/ items = (1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5)/ select = current(cdic)/ selectionrate = trial***************************************XXXX (XX)***************************************Display**************************************/ items = (2,3,4,5,1,3,4,5,1,2,4,5,1,2,3,5,1,2,3,4)/ select = noreplacenorepeat/ selectionrate = trial***************************************Word**************************************/ items = (1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)/ select = current(cdxx)/ selectionrate = trial***************************************************************************************************************Items: Color Words**************************************************************************************************************/1 ="         RED         "/2 ="        GREEN        "/3 ="        BLUE         "/4 ="       YELLOW        "/5="         XXXX         "***************************************************************************************************************INSTRUCTIONS**************************************************************************************************************/ items = instructions/ select = sequence/ size = (85%, 85%)/ txbgcolor = (transparent)/ fontstyle = ("Verdana", 3.00%, true)/ erase = false/ resetinterval = 0/ 1 = "~rYou will see a series of words displayed in different colors.Name aloud the color of the presented word - red, yellow, green, blue, or black - as quickly and as accurately as possible.  If you make a mistake, keep going."/ 2 = "~rYou will see a series of words displayed in different colors.Name aloud the color of the presented word - red, yellow, green, blue, or black - as quickly and as accurately as possible.  If you make a mistake, keep going.~rFor example, when this word appears,~r~r~ryou would respond with ''red'' as quickly as possible."/ 3 = "~rYou will see a series of words displayed in different colors.Name aloud the color of the presented word - red, yellow, green, blue, or black - as quickly and as accurately as possible.  If you make a mistake, keep going.~rFor example, when this word appears,~r~r~ryou would respond with ''red'' as quickly as possible.~rIf this word appears,~r~r~ryou would respond with ''blue'' as quickly as possible. ~rLet's practice a few words before we begin."/ 4 = "~r~r~r~r~r~rIf you have any questions, please ask the study coordinator now.~rWhen you are ready to begin, press the SPACE BAR."/ 5 = "~r~r~r~r~r~rPlease let the study coordinator know you have finished."/ items = example01/ select = sequence/ resetinterval = 0/ txcolor = (red)/ txbgcolor = (transparent)/ position = (50%, 41%)/ erase = false/ 1 = " "/ 2 = "YELLOW"/ 3 = "YELLOW"/ 4 = " "/ items = example02/ select = sequence/ resetinterval = 0/ position = (50%, 63%)/ txcolor = (blue)/ txbgcolor = (transparent)/ erase = false/ 1 = " "/ 2 = " "/ 3 = "GREEN"/ 4 = " "/ 5 = " "/ items = navigation/ select = sequence/ resetinterval = 0/ fontstyle = ("Verdana", 3.00%, true)/ txbgcolor = (white)/ size = (87.5%, 5%)/ position = (50%, 90%)/ erase = false/ 1 = "Press the SPACEBAR to continue."/ 2 = "Press the SPACEBAR to continue."/ 3 = "Press the SPACE BAR when you are ready to begin."/ 4 = " "/ 5 = " " By Dave - 9/11/2012 One issue is the same as noted previously: You counter dependencies are off:/ items = (2,3,4,5,1,3,4,5,1,2,4,5,1,2,3,5,1,2,3,4)/ select = noreplacenorepeat/ selectionrate = trial***************************************Word**************************************/ items = (1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)/ select = current(cdxx)/ selectionrate = trialThe 1st counter holds 20 items, the 2nd counter holds 25. Obviously the last 5 listed cannot ever be selected. I recommed that -- before you go about changing / adapting an existing script - you work through the original script until you fully understand what it does, how it works and why.Best regards,~Dave By zzril - 9/13/2012 Thanks, but this isn't helpful. The documentation is sparse at best and the tutorials don't apply to the script I'm trying to write. Searches for counter dependencies and variations of that string return forum posts which are only marginally relevant. By Dave - 9/13/2012 Consider this:/ items = ("John", "Paul", "George", "Ringo")/ select = noreplacenorepeat/ items = ("Lennon", "McCartney", "Harrison", "Starr", "Ono")/ select = current(firstname)/ stimulusframes = [1=thename]/ validresponse = (57)/ items = ("<%counter.firstname.selectedvalue%> <%counter.lastname.selectedvalue%>")/ trials = [1-8=showbeatles]Ask yourself: Will you see the last name "Ono" when running the code? Why or why not?What will the following code produce as output:/ items = ("John", "Paul", "George", "Ringo")/ select = noreplace/ items = ("Lennon", "McCartney", "Harrison", "Starr", "Ono")/ select = noreplace/ stimulusframes = [1=thename]/ validresponse = (57)/ items = ("<%counter.firstname.selectedvalue%> <%counter.lastname.selectedvalue%>")/ trials = [1-8=showbeatles]What would you have to do to display every possible combination of first and last name? Apply this to your own script. By zzril - 9/17/2012 I understand that it's attempting to select a first and a last name for eight trials, though it would be difficult to know for sure since both scripts crash when I run them.I appreciate your attempts at assisting me in learning this software through examples, but it would be much more helpful if you could identify the specific issues with my script. The monkey also crashes the program when I run it, so I don't know where it's breaking down. By Dave - 9/17/2012 I understand that it's attempting to select a first and a last name for eight trials, though it would be difficult to know for sure since both scripts crash when I run them.This suggests you are either running an outdated Inquisit version (in which case: re-download and re-install) or there is something wrong with your system in general (not sure what you would want to do in this case). I have pointed out the issues in your script in my previous replies, none of which should lead to crashing. By Dave - 9/17/2012 Here are some errors when trying to parse the script you attached: /validresponse: 'No response' can not be specified unless the trial has a timeout.[...] /validresponse: 'No response' can not be specified unless the trial has a timeout. /validresponse: 'No response' can not be specified unless the trial has a timeout.[...]You have not defined any valid responses for the respective trial elements. E.g.:/ ontrialbegin = [values.stimcolor=counter.cdic.selectedvalue]/ ontrialbegin = [text.stimword.textcolor=getitem(counter.stimcolor, values.stimcolor)]/ ontrialbegin = [values.stimword=getitem(item.colorwords, counter.cwic.selectedvalue)]/ stimulustimes = [0=fixation;250=stimword]Thus Inquisit must assume you allow no response. But since the trial does not /timeout in any way, it would effectively go on forever. By zzril - 9/17/2012 Is there a way to simultaneously run / inputdevice = voice/ inputdevice = voicerecord By Dave - 9/17/2012 No, there isn't. By zzril - 9/26/2012 Since the following counter specifies a noreplacenorepeat, shouldn't I get six trials of each color word and 24 trials of the XXXX word in an experiment with 48 trials?:**********************************************************************************************************************************************************************************************************************************    Display**********************************************************************************************************************************************************************************************************************************/ items = (2,3,4,  1,3,4,  1,2,4,  1,2,3,  2,3,4,  1,3,4,  1,2,4,  1,2,3)/ select = noreplacenorepeat/ selectionrate = trial**********************************************************************************************************************************************************************************************************************************    Word**********************************************************************************************************************************************************************************************************************************/ items = (1,1,1,  2,2,2,  3,3,3,  4,4,4,  5,5,5,  6,6,6,  7,7,7,  8,8,8)/ select = current(cdic)/ selectionrate = trial**********************************************************************************************************************************************************************************************************************************    Items: Color Words**********************************************************************************************************************************************************************************************************************************/ 1  = "BLUE"/ 2 = "GREEN"/ 3 = "RED"/ 4 ="YELLOW"/ 5 ="XXXX"/ 6 ="XXXX"/ 7 ="XXXX"/ 8 ="XXXX"