counterbalanced stimuli


counterbalanced stimuli

Author
Message
James Charlie
James Charlie
New Member
New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)

Group: Forum Members
Posts: 5, Visits: 9
Hi,

I am trying to create a script that shows participants one pair of images (stimuli image and reference image) and asked them to choose which one is bigger. I have 5 stimuli images and 1 reference image. I try to make it counterbalanced so participants will see equal amount of each stimuli image. Is there a way to counterbalanced this?

Here is my script:

<defaults >
/ screencolor = black
/ txcolor = white
/ txbgcolor = black
/ windowaspectratio = (4,3)
</defaults>


<values>
/completed = 0
/stiminterval = 0
/ aset = 1
/a1=0
/b1=0
</values>

<parameters>
/trialtimeout=10000
/instructiontime=2000
/breaktime=30000
</parameters>


=============================================================================
Instruction page
=============================================================================
<instruct instruction>
/ timeout = parameters.instructiontime
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/ screencolor = black
/ txcolor = white
/ windowsize = (100%, 100%)
</instruct>


<page instruction1>

              Welcome
^^In this task two pictures containing different portion size will appear on your screen.

^^Please answer the question 'Which one of the pictures has a larger portion ?' by pressing 'F' for the first one and 'J' for the second one.

^^You will have 50 comparison pairs and then a break of 30 seconds.

^^ You will perform a practice trial containing 6 comparison pairs before starting the real test.

^^   Press the space bar to start your practice session!

</page>

<page instruction2>

^^^^^         Get ready for another trial !

^^^^         Press the space bar to start

</page>


<item poolA>
/1="Chips1.jpg"
/2="Chips2.jpg"
/3="Chips3.jpg"
/4="Chips4.jpg"
/5="Chips5.jpg"
/6="Choco1.jpg"
/7="Choco2.jpg"
/8="Choco3.jpg"
/9="Choco4.jpg"
/10="Choco5.jpg"
/11="Yoghurt1.jpg"
/12="Yoghurt2.jpg"
/13="Yoghurt3.jpg"
/14="Yoghurt4.jpg"
/15="Yoghurt5.jpg"
</item>

<list chips_set1>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers1>
/ items = (list.chips_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set1>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers1>
/ items = (list.choco_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set1>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers1>
/ items = (list.Yoghurt_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture a1>
/ items = poolA
/select=values.a1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<item poolB>
/1="Chips6.jpg"
/2="Chips7.jpg"
/3="Chips8.jpg"
/4="Chips9.jpg"
/5="Chips10.jpg"
/6="Choco6.jpg"
/7="Choco7.jpg"
/8="Choco8.jpg"
/9="Choco9.jpg"
/10="Choco10.jpg"
/11="Yoghurt6.jpg"
/12="Yoghurt7.jpg"
/13="Yoghurt8.jpg"
/14="Yoghurt9.jpg"
/15="Yoghurt10.jpg"
</item>

<list Chips_set2>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers2>
/ items = (list.Chips_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set2>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers2>
/ items = (list.choco_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set2>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers2>
/ items = (list.Yoghurt_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture b1>
/ items = poolb
/select=values.b1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<list asetnumbers>
/ poolsize = 1
</list>

===========================================================================================
Reference image
============================================================================================

<picture Chipsreference>
/items=("Chips0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Chocoreference>
/items=("Choco0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Yoghurtreference>
/items=("Yoghurt0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>



<text questions>
/ items = ("Which one of the pictures has a larger portion?")
/ fontstyle = ("Arial", 5%, false, false, false, false, 5, 1)
/ valign = top
/ halign = center
/ position = (50,20)

</text>

<Text ChoiceA>
/ items = ("Press F= First picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (20,50)
</text>

<Text ChoiceB>
/ items = ("Press J= Second picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (75,50)

</text>

========================================================================================================
Chips trial
========================================================================================================

<trial Chipsa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chipsb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>


========================================================================================================
Choco trial
========================================================================================================

<trial Chocoa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocoa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocob1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chocob2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

========================================================================================================
Yoghurt trial
========================================================================================================

<trial Yoghurta1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurta2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurtb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Yoghurtb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

=================================================================================================================
Break
================================================================================================================

<clock timer>
/ format = "mm:ss"
/ mode = timer
/ erase = false
/ position = (50%, 50%)
/ resetrate = block
/ txbgcolor = black
/ txcolor = white
/ size = (100,100)
/ position = (50,60)
/ timeout = parameters.breaktime
</clock>

<text break>
/items=("Please have a break")
/ fontstyle = ("Arial", 6.67%, false, false, false, false, 5, 1)
</text>

<trial break>
/stimulusframes=[1=break, timer]
/timeout= parameters.breaktime
</trial>

===================================================================================================
Block
======================================================================================================

<block chipsblock>

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2);51=break]
/ preinstructions = (instruction2)
</block>

<block chocoblock>
/ trials = [1-50=noreplace(chocoa1,chocoa2,chocob1,chocob2);51=break]
/ preinstructions = (instruction2)
</block>

<block Yoghurtblock>
/ trials = [1-50=noreplace(Yoghurta1,Yoghurta2,Yoghurtb1,Yoghurtb2);51=break]
/ preinstructions = (instruction2)
</block>

<block practice>
/trials= [1-2=noreplace(chipsa1,chipsb2);3-4= noreplace(chocoa2,chocob2);5-6=noreplace(Yoghurta1,Yoghurtb2)]
/ preinstructions = (instruction1)
</block>


==================================================================================================
Experiment
=================================================================================================

<expt study>
/ blocks = [1=practice; 2-7=noreplace(Chipsblock,Chocoblock,Yoghurtblock)]
</expt>

==================================================================================================
Data
==================================================================================================

<data>
/columns = (build, computer.platform, date, time, subject, group, blockcode, blocknum, trialcode, trialnum,
stimulus,stimulus,stimulus,response, correct, latency)
/ separatefiles = true
</data>


Dave
Dave
Supreme Being
Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)

Group: Administrators
Posts: 9.4K, Visits: 42K
James Charlie - Monday, April 1, 2019
Hi,

I am trying to create a script that shows participants one pair of images (stimuli image and reference image) and asked them to choose which one is bigger. I have 5 stimuli images and 1 reference image. I try to make it counterbalanced so participants will see equal amount of each stimuli image. Is there a way to counterbalanced this?

Here is my script:

<defaults >
/ screencolor = black
/ txcolor = white
/ txbgcolor = black
/ windowaspectratio = (4,3)
</defaults>


<values>
/completed = 0
/stiminterval = 0
/ aset = 1
/a1=0
/b1=0
</values>

<parameters>
/trialtimeout=10000
/instructiontime=2000
/breaktime=30000
</parameters>


=============================================================================
Instruction page
=============================================================================
<instruct instruction>
/ timeout = parameters.instructiontime
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/ screencolor = black
/ txcolor = white
/ windowsize = (100%, 100%)
</instruct>


<page instruction1>

              Welcome
^^In this task two pictures containing different portion size will appear on your screen.

^^Please answer the question 'Which one of the pictures has a larger portion ?' by pressing 'F' for the first one and 'J' for the second one.

^^You will have 50 comparison pairs and then a break of 30 seconds.

^^ You will perform a practice trial containing 6 comparison pairs before starting the real test.

^^   Press the space bar to start your practice session!

</page>

<page instruction2>

^^^^^         Get ready for another trial !

^^^^         Press the space bar to start

</page>


<item poolA>
/1="Chips1.jpg"
/2="Chips2.jpg"
/3="Chips3.jpg"
/4="Chips4.jpg"
/5="Chips5.jpg"
/6="Choco1.jpg"
/7="Choco2.jpg"
/8="Choco3.jpg"
/9="Choco4.jpg"
/10="Choco5.jpg"
/11="Yoghurt1.jpg"
/12="Yoghurt2.jpg"
/13="Yoghurt3.jpg"
/14="Yoghurt4.jpg"
/15="Yoghurt5.jpg"
</item>

<list chips_set1>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers1>
/ items = (list.chips_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set1>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers1>
/ items = (list.choco_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set1>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers1>
/ items = (list.Yoghurt_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture a1>
/ items = poolA
/select=values.a1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<item poolB>
/1="Chips6.jpg"
/2="Chips7.jpg"
/3="Chips8.jpg"
/4="Chips9.jpg"
/5="Chips10.jpg"
/6="Choco6.jpg"
/7="Choco7.jpg"
/8="Choco8.jpg"
/9="Choco9.jpg"
/10="Choco10.jpg"
/11="Yoghurt6.jpg"
/12="Yoghurt7.jpg"
/13="Yoghurt8.jpg"
/14="Yoghurt9.jpg"
/15="Yoghurt10.jpg"
</item>

<list Chips_set2>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers2>
/ items = (list.Chips_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set2>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers2>
/ items = (list.choco_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set2>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers2>
/ items = (list.Yoghurt_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture b1>
/ items = poolb
/select=values.b1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<list asetnumbers>
/ poolsize = 1
</list>

===========================================================================================
Reference image
============================================================================================

<picture Chipsreference>
/items=("Chips0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Chocoreference>
/items=("Choco0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Yoghurtreference>
/items=("Yoghurt0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>



<text questions>
/ items = ("Which one of the pictures has a larger portion?")
/ fontstyle = ("Arial", 5%, false, false, false, false, 5, 1)
/ valign = top
/ halign = center
/ position = (50,20)

</text>

<Text ChoiceA>
/ items = ("Press F= First picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (20,50)
</text>

<Text ChoiceB>
/ items = ("Press J= Second picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (75,50)

</text>

========================================================================================================
Chips trial
========================================================================================================

<trial Chipsa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chipsb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>


========================================================================================================
Choco trial
========================================================================================================

<trial Chocoa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocoa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocob1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chocob2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

========================================================================================================
Yoghurt trial
========================================================================================================

<trial Yoghurta1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurta2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurtb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Yoghurtb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

=================================================================================================================
Break
================================================================================================================

<clock timer>
/ format = "mm:ss"
/ mode = timer
/ erase = false
/ position = (50%, 50%)
/ resetrate = block
/ txbgcolor = black
/ txcolor = white
/ size = (100,100)
/ position = (50,60)
/ timeout = parameters.breaktime
</clock>

<text break>
/items=("Please have a break")
/ fontstyle = ("Arial", 6.67%, false, false, false, false, 5, 1)
</text>

<trial break>
/stimulusframes=[1=break, timer]
/timeout= parameters.breaktime
</trial>

===================================================================================================
Block
======================================================================================================

<block chipsblock>

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2);51=break]
/ preinstructions = (instruction2)
</block>

<block chocoblock>
/ trials = [1-50=noreplace(chocoa1,chocoa2,chocob1,chocob2);51=break]
/ preinstructions = (instruction2)
</block>

<block Yoghurtblock>
/ trials = [1-50=noreplace(Yoghurta1,Yoghurta2,Yoghurtb1,Yoghurtb2);51=break]
/ preinstructions = (instruction2)
</block>

<block practice>
/trials= [1-2=noreplace(chipsa1,chipsb2);3-4= noreplace(chocoa2,chocob2);5-6=noreplace(Yoghurta1,Yoghurtb2)]
/ preinstructions = (instruction1)
</block>


==================================================================================================
Experiment
=================================================================================================

<expt study>
/ blocks = [1=practice; 2-7=noreplace(Chipsblock,Chocoblock,Yoghurtblock)]
</expt>

==================================================================================================
Data
==================================================================================================

<data>
/columns = (build, computer.platform, date, time, subject, group, blockcode, blocknum, trialcode, trialnum,
stimulus,stimulus,stimulus,response, correct, latency)
/ separatefiles = true
</data>


It's not clear to me what specifically you aim to counterbalance. Could you please elaborate?

Also, please don't paste entire scripts into the message body. Instead, please attach the actual script file via +Insert -> Add File to your post. In addition, if your script requires any external files (images), please provide those files as well.

James Charlie
James Charlie
New Member
New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)

Group: Forum Members
Posts: 5, Visits: 9
Dave - Monday, April 1, 2019
James Charlie - Monday, April 1, 2019
Hi,

I am trying to create a script that shows participants one pair of images (stimuli image and reference image) and asked them to choose which one is bigger. I have 5 stimuli images and 1 reference image. I try to make it counterbalanced so participants will see equal amount of each stimuli image. Is there a way to counterbalanced this?

Here is my script:

<defaults >
/ screencolor = black
/ txcolor = white
/ txbgcolor = black
/ windowaspectratio = (4,3)
</defaults>


<values>
/completed = 0
/stiminterval = 0
/ aset = 1
/a1=0
/b1=0
</values>

<parameters>
/trialtimeout=10000
/instructiontime=2000
/breaktime=30000
</parameters>


=============================================================================
Instruction page
=============================================================================
<instruct instruction>
/ timeout = parameters.instructiontime
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/ screencolor = black
/ txcolor = white
/ windowsize = (100%, 100%)
</instruct>


<page instruction1>

              Welcome
^^In this task two pictures containing different portion size will appear on your screen.

^^Please answer the question 'Which one of the pictures has a larger portion ?' by pressing 'F' for the first one and 'J' for the second one.

^^You will have 50 comparison pairs and then a break of 30 seconds.

^^ You will perform a practice trial containing 6 comparison pairs before starting the real test.

^^   Press the space bar to start your practice session!

</page>

<page instruction2>

^^^^^         Get ready for another trial !

^^^^         Press the space bar to start

</page>


<item poolA>
/1="Chips1.jpg"
/2="Chips2.jpg"
/3="Chips3.jpg"
/4="Chips4.jpg"
/5="Chips5.jpg"
/6="Choco1.jpg"
/7="Choco2.jpg"
/8="Choco3.jpg"
/9="Choco4.jpg"
/10="Choco5.jpg"
/11="Yoghurt1.jpg"
/12="Yoghurt2.jpg"
/13="Yoghurt3.jpg"
/14="Yoghurt4.jpg"
/15="Yoghurt5.jpg"
</item>

<list chips_set1>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers1>
/ items = (list.chips_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set1>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers1>
/ items = (list.choco_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set1>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers1>
/ items = (list.Yoghurt_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture a1>
/ items = poolA
/select=values.a1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<item poolB>
/1="Chips6.jpg"
/2="Chips7.jpg"
/3="Chips8.jpg"
/4="Chips9.jpg"
/5="Chips10.jpg"
/6="Choco6.jpg"
/7="Choco7.jpg"
/8="Choco8.jpg"
/9="Choco9.jpg"
/10="Choco10.jpg"
/11="Yoghurt6.jpg"
/12="Yoghurt7.jpg"
/13="Yoghurt8.jpg"
/14="Yoghurt9.jpg"
/15="Yoghurt10.jpg"
</item>

<list Chips_set2>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers2>
/ items = (list.Chips_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set2>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers2>
/ items = (list.choco_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set2>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers2>
/ items = (list.Yoghurt_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture b1>
/ items = poolb
/select=values.b1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<list asetnumbers>
/ poolsize = 1
</list>

===========================================================================================
Reference image
============================================================================================

<picture Chipsreference>
/items=("Chips0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Chocoreference>
/items=("Choco0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Yoghurtreference>
/items=("Yoghurt0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>



<text questions>
/ items = ("Which one of the pictures has a larger portion?")
/ fontstyle = ("Arial", 5%, false, false, false, false, 5, 1)
/ valign = top
/ halign = center
/ position = (50,20)

</text>

<Text ChoiceA>
/ items = ("Press F= First picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (20,50)
</text>

<Text ChoiceB>
/ items = ("Press J= Second picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (75,50)

</text>

========================================================================================================
Chips trial
========================================================================================================

<trial Chipsa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chipsb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>


========================================================================================================
Choco trial
========================================================================================================

<trial Chocoa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocoa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocob1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chocob2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

========================================================================================================
Yoghurt trial
========================================================================================================

<trial Yoghurta1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurta2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurtb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Yoghurtb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

=================================================================================================================
Break
================================================================================================================

<clock timer>
/ format = "mm:ss"
/ mode = timer
/ erase = false
/ position = (50%, 50%)
/ resetrate = block
/ txbgcolor = black
/ txcolor = white
/ size = (100,100)
/ position = (50,60)
/ timeout = parameters.breaktime
</clock>

<text break>
/items=("Please have a break")
/ fontstyle = ("Arial", 6.67%, false, false, false, false, 5, 1)
</text>

<trial break>
/stimulusframes=[1=break, timer]
/timeout= parameters.breaktime
</trial>

===================================================================================================
Block
======================================================================================================

<block chipsblock>

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2);51=break]
/ preinstructions = (instruction2)
</block>

<block chocoblock>
/ trials = [1-50=noreplace(chocoa1,chocoa2,chocob1,chocob2);51=break]
/ preinstructions = (instruction2)
</block>

<block Yoghurtblock>
/ trials = [1-50=noreplace(Yoghurta1,Yoghurta2,Yoghurtb1,Yoghurtb2);51=break]
/ preinstructions = (instruction2)
</block>

<block practice>
/trials= [1-2=noreplace(chipsa1,chipsb2);3-4= noreplace(chocoa2,chocob2);5-6=noreplace(Yoghurta1,Yoghurtb2)]
/ preinstructions = (instruction1)
</block>


==================================================================================================
Experiment
=================================================================================================

<expt study>
/ blocks = [1=practice; 2-7=noreplace(Chipsblock,Chocoblock,Yoghurtblock)]
</expt>

==================================================================================================
Data
==================================================================================================

<data>
/columns = (build, computer.platform, date, time, subject, group, blockcode, blocknum, trialcode, trialnum,
stimulus,stimulus,stimulus,response, correct, latency)
/ separatefiles = true
</data>


It's not clear to me what specifically you aim to counterbalance. Could you please elaborate?

Also, please don't paste entire scripts into the message body. Instead, please attach the actual script file via +Insert -> Add File to your post. In addition, if your script requires any external files (images), please provide those files as well.

Hi Dave,

I am trying to counterbalance the stimuli image. So, I want participants to see each stimuli image (chips1.jpg-Chips10.jpg) 5 times for each block. With the current script, one of stimuli images can appear more than 5 times or only 3-4 times. Is there a way to make all image will always appear 5 times in one block?

Thank you for your help.


Dave
Dave
Supreme Being
Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)

Group: Administrators
Posts: 9.4K, Visits: 42K
James Charlie - Monday, April 1, 2019
Dave - Monday, April 1, 2019
James Charlie - Monday, April 1, 2019
Hi,

I am trying to create a script that shows participants one pair of images (stimuli image and reference image) and asked them to choose which one is bigger. I have 5 stimuli images and 1 reference image. I try to make it counterbalanced so participants will see equal amount of each stimuli image. Is there a way to counterbalanced this?

Here is my script:

<defaults >
/ screencolor = black
/ txcolor = white
/ txbgcolor = black
/ windowaspectratio = (4,3)
</defaults>


<values>
/completed = 0
/stiminterval = 0
/ aset = 1
/a1=0
/b1=0
</values>

<parameters>
/trialtimeout=10000
/instructiontime=2000
/breaktime=30000
</parameters>


=============================================================================
Instruction page
=============================================================================
<instruct instruction>
/ timeout = parameters.instructiontime
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/ screencolor = black
/ txcolor = white
/ windowsize = (100%, 100%)
</instruct>


<page instruction1>

              Welcome
^^In this task two pictures containing different portion size will appear on your screen.

^^Please answer the question 'Which one of the pictures has a larger portion ?' by pressing 'F' for the first one and 'J' for the second one.

^^You will have 50 comparison pairs and then a break of 30 seconds.

^^ You will perform a practice trial containing 6 comparison pairs before starting the real test.

^^   Press the space bar to start your practice session!

</page>

<page instruction2>

^^^^^         Get ready for another trial !

^^^^         Press the space bar to start

</page>


<item poolA>
/1="Chips1.jpg"
/2="Chips2.jpg"
/3="Chips3.jpg"
/4="Chips4.jpg"
/5="Chips5.jpg"
/6="Choco1.jpg"
/7="Choco2.jpg"
/8="Choco3.jpg"
/9="Choco4.jpg"
/10="Choco5.jpg"
/11="Yoghurt1.jpg"
/12="Yoghurt2.jpg"
/13="Yoghurt3.jpg"
/14="Yoghurt4.jpg"
/15="Yoghurt5.jpg"
</item>

<list chips_set1>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers1>
/ items = (list.chips_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set1>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers1>
/ items = (list.choco_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set1>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers1>
/ items = (list.Yoghurt_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture a1>
/ items = poolA
/select=values.a1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<item poolB>
/1="Chips6.jpg"
/2="Chips7.jpg"
/3="Chips8.jpg"
/4="Chips9.jpg"
/5="Chips10.jpg"
/6="Choco6.jpg"
/7="Choco7.jpg"
/8="Choco8.jpg"
/9="Choco9.jpg"
/10="Choco10.jpg"
/11="Yoghurt6.jpg"
/12="Yoghurt7.jpg"
/13="Yoghurt8.jpg"
/14="Yoghurt9.jpg"
/15="Yoghurt10.jpg"
</item>

<list Chips_set2>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers2>
/ items = (list.Chips_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set2>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers2>
/ items = (list.choco_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set2>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers2>
/ items = (list.Yoghurt_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture b1>
/ items = poolb
/select=values.b1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<list asetnumbers>
/ poolsize = 1
</list>

===========================================================================================
Reference image
============================================================================================

<picture Chipsreference>
/items=("Chips0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Chocoreference>
/items=("Choco0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Yoghurtreference>
/items=("Yoghurt0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>



<text questions>
/ items = ("Which one of the pictures has a larger portion?")
/ fontstyle = ("Arial", 5%, false, false, false, false, 5, 1)
/ valign = top
/ halign = center
/ position = (50,20)

</text>

<Text ChoiceA>
/ items = ("Press F= First picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (20,50)
</text>

<Text ChoiceB>
/ items = ("Press J= Second picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (75,50)

</text>

========================================================================================================
Chips trial
========================================================================================================

<trial Chipsa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chipsb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>


========================================================================================================
Choco trial
========================================================================================================

<trial Chocoa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocoa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocob1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chocob2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

========================================================================================================
Yoghurt trial
========================================================================================================

<trial Yoghurta1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurta2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurtb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Yoghurtb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

=================================================================================================================
Break
================================================================================================================

<clock timer>
/ format = "mm:ss"
/ mode = timer
/ erase = false
/ position = (50%, 50%)
/ resetrate = block
/ txbgcolor = black
/ txcolor = white
/ size = (100,100)
/ position = (50,60)
/ timeout = parameters.breaktime
</clock>

<text break>
/items=("Please have a break")
/ fontstyle = ("Arial", 6.67%, false, false, false, false, 5, 1)
</text>

<trial break>
/stimulusframes=[1=break, timer]
/timeout= parameters.breaktime
</trial>

===================================================================================================
Block
======================================================================================================

<block chipsblock>

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2);51=break]
/ preinstructions = (instruction2)
</block>

<block chocoblock>
/ trials = [1-50=noreplace(chocoa1,chocoa2,chocob1,chocob2);51=break]
/ preinstructions = (instruction2)
</block>

<block Yoghurtblock>
/ trials = [1-50=noreplace(Yoghurta1,Yoghurta2,Yoghurtb1,Yoghurtb2);51=break]
/ preinstructions = (instruction2)
</block>

<block practice>
/trials= [1-2=noreplace(chipsa1,chipsb2);3-4= noreplace(chocoa2,chocob2);5-6=noreplace(Yoghurta1,Yoghurtb2)]
/ preinstructions = (instruction1)
</block>


==================================================================================================
Experiment
=================================================================================================

<expt study>
/ blocks = [1=practice; 2-7=noreplace(Chipsblock,Chocoblock,Yoghurtblock)]
</expt>

==================================================================================================
Data
==================================================================================================

<data>
/columns = (build, computer.platform, date, time, subject, group, blockcode, blocknum, trialcode, trialnum,
stimulus,stimulus,stimulus,response, correct, latency)
/ separatefiles = true
</data>


It's not clear to me what specifically you aim to counterbalance. Could you please elaborate?

Also, please don't paste entire scripts into the message body. Instead, please attach the actual script file via +Insert -> Add File to your post. In addition, if your script requires any external files (images), please provide those files as well.

Hi Dave,

I am trying to counterbalance the stimuli image. So, I want participants to see each stimuli image (chips1.jpg-Chips10.jpg) 5 times for each block. With the current script, one of stimuli images can appear more than 5 times or only 3-4 times. Is there a way to make all image will always appear 5 times in one block?

Thank you for your help.


Well, you're running 50 trials in a block

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2)

and you're sampling 4 trial elements in equal proportions. Mathematically, that doesn't quite work? 50/4 = 12.5, and since there can be no such thing as "half a trial," you'll necessarily get random imbalances.

I'm guessing you want to have something where the number of chipsa1 + chipsa2 trials = 25 and same for chipsb1 + chipsb2 trials, resulting in 5x5 presentations of items 1-5 and 6-10 respectively. However, to do this, you would have to decide whether you want to run 12 chipsa1 trials and 13 chipsa2 trials or the reverse. Then enter the requisite amount of each trial into the noreplace() pool in the block's /trials.

James Charlie
James Charlie
New Member
New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)

Group: Forum Members
Posts: 5, Visits: 9
Dave - Monday, April 1, 2019
James Charlie - Monday, April 1, 2019
Dave - Monday, April 1, 2019
James Charlie - Monday, April 1, 2019
Hi,

I am trying to create a script that shows participants one pair of images (stimuli image and reference image) and asked them to choose which one is bigger. I have 5 stimuli images and 1 reference image. I try to make it counterbalanced so participants will see equal amount of each stimuli image. Is there a way to counterbalanced this?

Here is my script:

<defaults >
/ screencolor = black
/ txcolor = white
/ txbgcolor = black
/ windowaspectratio = (4,3)
</defaults>


<values>
/completed = 0
/stiminterval = 0
/ aset = 1
/a1=0
/b1=0
</values>

<parameters>
/trialtimeout=10000
/instructiontime=2000
/breaktime=30000
</parameters>


=============================================================================
Instruction page
=============================================================================
<instruct instruction>
/ timeout = parameters.instructiontime
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/ screencolor = black
/ txcolor = white
/ windowsize = (100%, 100%)
</instruct>


<page instruction1>

              Welcome
^^In this task two pictures containing different portion size will appear on your screen.

^^Please answer the question 'Which one of the pictures has a larger portion ?' by pressing 'F' for the first one and 'J' for the second one.

^^You will have 50 comparison pairs and then a break of 30 seconds.

^^ You will perform a practice trial containing 6 comparison pairs before starting the real test.

^^   Press the space bar to start your practice session!

</page>

<page instruction2>

^^^^^         Get ready for another trial !

^^^^         Press the space bar to start

</page>


<item poolA>
/1="Chips1.jpg"
/2="Chips2.jpg"
/3="Chips3.jpg"
/4="Chips4.jpg"
/5="Chips5.jpg"
/6="Choco1.jpg"
/7="Choco2.jpg"
/8="Choco3.jpg"
/9="Choco4.jpg"
/10="Choco5.jpg"
/11="Yoghurt1.jpg"
/12="Yoghurt2.jpg"
/13="Yoghurt3.jpg"
/14="Yoghurt4.jpg"
/15="Yoghurt5.jpg"
</item>

<list chips_set1>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers1>
/ items = (list.chips_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set1>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers1>
/ items = (list.choco_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set1>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers1>
/ items = (list.Yoghurt_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture a1>
/ items = poolA
/select=values.a1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<item poolB>
/1="Chips6.jpg"
/2="Chips7.jpg"
/3="Chips8.jpg"
/4="Chips9.jpg"
/5="Chips10.jpg"
/6="Choco6.jpg"
/7="Choco7.jpg"
/8="Choco8.jpg"
/9="Choco9.jpg"
/10="Choco10.jpg"
/11="Yoghurt6.jpg"
/12="Yoghurt7.jpg"
/13="Yoghurt8.jpg"
/14="Yoghurt9.jpg"
/15="Yoghurt10.jpg"
</item>

<list Chips_set2>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers2>
/ items = (list.Chips_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set2>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers2>
/ items = (list.choco_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set2>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers2>
/ items = (list.Yoghurt_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture b1>
/ items = poolb
/select=values.b1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<list asetnumbers>
/ poolsize = 1
</list>

===========================================================================================
Reference image
============================================================================================

<picture Chipsreference>
/items=("Chips0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Chocoreference>
/items=("Choco0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Yoghurtreference>
/items=("Yoghurt0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>



<text questions>
/ items = ("Which one of the pictures has a larger portion?")
/ fontstyle = ("Arial", 5%, false, false, false, false, 5, 1)
/ valign = top
/ halign = center
/ position = (50,20)

</text>

<Text ChoiceA>
/ items = ("Press F= First picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (20,50)
</text>

<Text ChoiceB>
/ items = ("Press J= Second picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (75,50)

</text>

========================================================================================================
Chips trial
========================================================================================================

<trial Chipsa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chipsb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>


========================================================================================================
Choco trial
========================================================================================================

<trial Chocoa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocoa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocob1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chocob2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

========================================================================================================
Yoghurt trial
========================================================================================================

<trial Yoghurta1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurta2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurtb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Yoghurtb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

=================================================================================================================
Break
================================================================================================================

<clock timer>
/ format = "mm:ss"
/ mode = timer
/ erase = false
/ position = (50%, 50%)
/ resetrate = block
/ txbgcolor = black
/ txcolor = white
/ size = (100,100)
/ position = (50,60)
/ timeout = parameters.breaktime
</clock>

<text break>
/items=("Please have a break")
/ fontstyle = ("Arial", 6.67%, false, false, false, false, 5, 1)
</text>

<trial break>
/stimulusframes=[1=break, timer]
/timeout= parameters.breaktime
</trial>

===================================================================================================
Block
======================================================================================================

<block chipsblock>

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2);51=break]
/ preinstructions = (instruction2)
</block>

<block chocoblock>
/ trials = [1-50=noreplace(chocoa1,chocoa2,chocob1,chocob2);51=break]
/ preinstructions = (instruction2)
</block>

<block Yoghurtblock>
/ trials = [1-50=noreplace(Yoghurta1,Yoghurta2,Yoghurtb1,Yoghurtb2);51=break]
/ preinstructions = (instruction2)
</block>

<block practice>
/trials= [1-2=noreplace(chipsa1,chipsb2);3-4= noreplace(chocoa2,chocob2);5-6=noreplace(Yoghurta1,Yoghurtb2)]
/ preinstructions = (instruction1)
</block>


==================================================================================================
Experiment
=================================================================================================

<expt study>
/ blocks = [1=practice; 2-7=noreplace(Chipsblock,Chocoblock,Yoghurtblock)]
</expt>

==================================================================================================
Data
==================================================================================================

<data>
/columns = (build, computer.platform, date, time, subject, group, blockcode, blocknum, trialcode, trialnum,
stimulus,stimulus,stimulus,response, correct, latency)
/ separatefiles = true
</data>


It's not clear to me what specifically you aim to counterbalance. Could you please elaborate?

Also, please don't paste entire scripts into the message body. Instead, please attach the actual script file via +Insert -> Add File to your post. In addition, if your script requires any external files (images), please provide those files as well.

Hi Dave,

I am trying to counterbalance the stimuli image. So, I want participants to see each stimuli image (chips1.jpg-Chips10.jpg) 5 times for each block. With the current script, one of stimuli images can appear more than 5 times or only 3-4 times. Is there a way to make all image will always appear 5 times in one block?

Thank you for your help.


Well, you're running 50 trials in a block

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2)

and you're sampling 4 trial elements in equal proportions. Mathematically, that doesn't quite work? 50/4 = 12.5, and since there can be no such thing as "half a trial," you'll necessarily get random imbalances.

I'm guessing you want to have something where the number of chipsa1 + chipsa2 trials = 25 and same for chipsb1 + chipsb2 trials, resulting in 5x5 presentations of items 1-5 and 6-10 respectively. However, to do this, you would have to decide whether you want to run 12 chipsa1 trials and 13 chipsa2 trials or the reverse. Then enter the requisite amount of each trial into the noreplace() pool in the block's /trials.

Hi Dave,

Thank you for pointing that out. I try make it equal by reducing the number of trial to 40, which means each image should appear 4 times. Some of the image still appear 5 times and other appear 3 times. Please find the attached script.

Attachments
portionsizetrial.iqx (6 views, 11.00 KB)
chips0.jpg (10 views, 111.00 KB)
chips1.jpg (10 views, 96.00 KB)
chips4.jpg (7 views, 111.00 KB)
chips2.jpg (10 views, 101.00 KB)
chips3.jpg (15 views, 100.00 KB)
chips5.jpg (12 views, 103.00 KB)
chips6.jpg (12 views, 106.00 KB)
chips7.jpg (9 views, 124.00 KB)
chips8.jpg (8 views, 123.00 KB)
chips10.jpg (14 views, 122.00 KB)
chips9.jpg (13 views, 116.00 KB)
Dave
Dave
Supreme Being
Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)Supreme Being (589K reputation)

Group: Administrators
Posts: 9.4K, Visits: 42K
James Charlie - Monday, April 1, 2019
Dave - Monday, April 1, 2019
James Charlie - Monday, April 1, 2019
Dave - Monday, April 1, 2019
James Charlie - Monday, April 1, 2019
Hi,

I am trying to create a script that shows participants one pair of images (stimuli image and reference image) and asked them to choose which one is bigger. I have 5 stimuli images and 1 reference image. I try to make it counterbalanced so participants will see equal amount of each stimuli image. Is there a way to counterbalanced this?

Here is my script:

<defaults >
/ screencolor = black
/ txcolor = white
/ txbgcolor = black
/ windowaspectratio = (4,3)
</defaults>


<values>
/completed = 0
/stiminterval = 0
/ aset = 1
/a1=0
/b1=0
</values>

<parameters>
/trialtimeout=10000
/instructiontime=2000
/breaktime=30000
</parameters>


=============================================================================
Instruction page
=============================================================================
<instruct instruction>
/ timeout = parameters.instructiontime
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/ screencolor = black
/ txcolor = white
/ windowsize = (100%, 100%)
</instruct>


<page instruction1>

              Welcome
^^In this task two pictures containing different portion size will appear on your screen.

^^Please answer the question 'Which one of the pictures has a larger portion ?' by pressing 'F' for the first one and 'J' for the second one.

^^You will have 50 comparison pairs and then a break of 30 seconds.

^^ You will perform a practice trial containing 6 comparison pairs before starting the real test.

^^   Press the space bar to start your practice session!

</page>

<page instruction2>

^^^^^         Get ready for another trial !

^^^^         Press the space bar to start

</page>


<item poolA>
/1="Chips1.jpg"
/2="Chips2.jpg"
/3="Chips3.jpg"
/4="Chips4.jpg"
/5="Chips5.jpg"
/6="Choco1.jpg"
/7="Choco2.jpg"
/8="Choco3.jpg"
/9="Choco4.jpg"
/10="Choco5.jpg"
/11="Yoghurt1.jpg"
/12="Yoghurt2.jpg"
/13="Yoghurt3.jpg"
/14="Yoghurt4.jpg"
/15="Yoghurt5.jpg"
</item>

<list chips_set1>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers1>
/ items = (list.chips_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set1>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers1>
/ items = (list.choco_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set1>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers1>
/ items = (list.Yoghurt_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture a1>
/ items = poolA
/select=values.a1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<item poolB>
/1="Chips6.jpg"
/2="Chips7.jpg"
/3="Chips8.jpg"
/4="Chips9.jpg"
/5="Chips10.jpg"
/6="Choco6.jpg"
/7="Choco7.jpg"
/8="Choco8.jpg"
/9="Choco9.jpg"
/10="Choco10.jpg"
/11="Yoghurt6.jpg"
/12="Yoghurt7.jpg"
/13="Yoghurt8.jpg"
/14="Yoghurt9.jpg"
/15="Yoghurt10.jpg"
</item>

<list Chips_set2>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers2>
/ items = (list.Chips_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set2>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers2>
/ items = (list.choco_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set2>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers2>
/ items = (list.Yoghurt_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture b1>
/ items = poolb
/select=values.b1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<list asetnumbers>
/ poolsize = 1
</list>

===========================================================================================
Reference image
============================================================================================

<picture Chipsreference>
/items=("Chips0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Chocoreference>
/items=("Choco0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Yoghurtreference>
/items=("Yoghurt0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>



<text questions>
/ items = ("Which one of the pictures has a larger portion?")
/ fontstyle = ("Arial", 5%, false, false, false, false, 5, 1)
/ valign = top
/ halign = center
/ position = (50,20)

</text>

<Text ChoiceA>
/ items = ("Press F= First picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (20,50)
</text>

<Text ChoiceB>
/ items = ("Press J= Second picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (75,50)

</text>

========================================================================================================
Chips trial
========================================================================================================

<trial Chipsa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chipsb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>


========================================================================================================
Choco trial
========================================================================================================

<trial Chocoa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocoa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocob1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chocob2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

========================================================================================================
Yoghurt trial
========================================================================================================

<trial Yoghurta1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurta2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurtb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Yoghurtb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

=================================================================================================================
Break
================================================================================================================

<clock timer>
/ format = "mm:ss"
/ mode = timer
/ erase = false
/ position = (50%, 50%)
/ resetrate = block
/ txbgcolor = black
/ txcolor = white
/ size = (100,100)
/ position = (50,60)
/ timeout = parameters.breaktime
</clock>

<text break>
/items=("Please have a break")
/ fontstyle = ("Arial", 6.67%, false, false, false, false, 5, 1)
</text>

<trial break>
/stimulusframes=[1=break, timer]
/timeout= parameters.breaktime
</trial>

===================================================================================================
Block
======================================================================================================

<block chipsblock>

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2);51=break]
/ preinstructions = (instruction2)
</block>

<block chocoblock>
/ trials = [1-50=noreplace(chocoa1,chocoa2,chocob1,chocob2);51=break]
/ preinstructions = (instruction2)
</block>

<block Yoghurtblock>
/ trials = [1-50=noreplace(Yoghurta1,Yoghurta2,Yoghurtb1,Yoghurtb2);51=break]
/ preinstructions = (instruction2)
</block>

<block practice>
/trials= [1-2=noreplace(chipsa1,chipsb2);3-4= noreplace(chocoa2,chocob2);5-6=noreplace(Yoghurta1,Yoghurtb2)]
/ preinstructions = (instruction1)
</block>


==================================================================================================
Experiment
=================================================================================================

<expt study>
/ blocks = [1=practice; 2-7=noreplace(Chipsblock,Chocoblock,Yoghurtblock)]
</expt>

==================================================================================================
Data
==================================================================================================

<data>
/columns = (build, computer.platform, date, time, subject, group, blockcode, blocknum, trialcode, trialnum,
stimulus,stimulus,stimulus,response, correct, latency)
/ separatefiles = true
</data>


It's not clear to me what specifically you aim to counterbalance. Could you please elaborate?

Also, please don't paste entire scripts into the message body. Instead, please attach the actual script file via +Insert -> Add File to your post. In addition, if your script requires any external files (images), please provide those files as well.

Hi Dave,

I am trying to counterbalance the stimuli image. So, I want participants to see each stimuli image (chips1.jpg-Chips10.jpg) 5 times for each block. With the current script, one of stimuli images can appear more than 5 times or only 3-4 times. Is there a way to make all image will always appear 5 times in one block?

Thank you for your help.


Well, you're running 50 trials in a block

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2)

and you're sampling 4 trial elements in equal proportions. Mathematically, that doesn't quite work? 50/4 = 12.5, and since there can be no such thing as "half a trial," you'll necessarily get random imbalances.

I'm guessing you want to have something where the number of chipsa1 + chipsa2 trials = 25 and same for chipsb1 + chipsb2 trials, resulting in 5x5 presentations of items 1-5 and 6-10 respectively. However, to do this, you would have to decide whether you want to run 12 chipsa1 trials and 13 chipsa2 trials or the reverse. Then enter the requisite amount of each trial into the noreplace() pool in the block's /trials.

Hi Dave,

Thank you for pointing that out. I try make it equal by reducing the number of trial to 40, which means each image should appear 4 times. Some of the image still appear 5 times and other appear 3 times. Please find the attached script.

No, if you only run the chipsblock, you'll get each item sampled exactly 4 times. See the attached data file.

However, since you're sampling items from the various lists during the practice block, you ought to reset those lists at the end of the practice block, otherwise the items that were sampled during the practice block will not be available for sampling at the start of the test blocks -- they will only become available again later, when the lists run out of other items to sample without replacement, at which point all items become available for sampling again. I.e. you'll want to do something like

<block practice>
/ onblockend = [
list.Chipsitemnumbers1.reset();
list.Chipsitemnumbers2.reset();
list.Chocoitemnumbers1.reset();
list.Chocoitemnumbers2.reset();
list.Yoghurtitemnumbers1.reset();
list.Yoghurtitemnumbers2.reset();
]

/trials= [1-2=noreplace(chipsa1,chipsb2);3-4= noreplace(chocoa2,chocob2);5-6=noreplace(Yoghurta1,Yoghurtb2)]
/ preinstructions = (instruction1)
</block>

Attachments
James Charlie
James Charlie
New Member
New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)New Member (40 reputation)

Group: Forum Members
Posts: 5, Visits: 9
Dave - Monday, April 1, 2019
James Charlie - Monday, April 1, 2019
Dave - Monday, April 1, 2019
James Charlie - Monday, April 1, 2019
Dave - Monday, April 1, 2019
James Charlie - Monday, April 1, 2019
Hi,

I am trying to create a script that shows participants one pair of images (stimuli image and reference image) and asked them to choose which one is bigger. I have 5 stimuli images and 1 reference image. I try to make it counterbalanced so participants will see equal amount of each stimuli image. Is there a way to counterbalanced this?

Here is my script:

<defaults >
/ screencolor = black
/ txcolor = white
/ txbgcolor = black
/ windowaspectratio = (4,3)
</defaults>


<values>
/completed = 0
/stiminterval = 0
/ aset = 1
/a1=0
/b1=0
</values>

<parameters>
/trialtimeout=10000
/instructiontime=2000
/breaktime=30000
</parameters>


=============================================================================
Instruction page
=============================================================================
<instruct instruction>
/ timeout = parameters.instructiontime
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/ screencolor = black
/ txcolor = white
/ windowsize = (100%, 100%)
</instruct>


<page instruction1>

              Welcome
^^In this task two pictures containing different portion size will appear on your screen.

^^Please answer the question 'Which one of the pictures has a larger portion ?' by pressing 'F' for the first one and 'J' for the second one.

^^You will have 50 comparison pairs and then a break of 30 seconds.

^^ You will perform a practice trial containing 6 comparison pairs before starting the real test.

^^   Press the space bar to start your practice session!

</page>

<page instruction2>

^^^^^         Get ready for another trial !

^^^^         Press the space bar to start

</page>


<item poolA>
/1="Chips1.jpg"
/2="Chips2.jpg"
/3="Chips3.jpg"
/4="Chips4.jpg"
/5="Chips5.jpg"
/6="Choco1.jpg"
/7="Choco2.jpg"
/8="Choco3.jpg"
/9="Choco4.jpg"
/10="Choco5.jpg"
/11="Yoghurt1.jpg"
/12="Yoghurt2.jpg"
/13="Yoghurt3.jpg"
/14="Yoghurt4.jpg"
/15="Yoghurt5.jpg"
</item>

<list chips_set1>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers1>
/ items = (list.chips_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set1>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers1>
/ items = (list.choco_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set1>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers1>
/ items = (list.Yoghurt_set1.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture a1>
/ items = poolA
/select=values.a1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<item poolB>
/1="Chips6.jpg"
/2="Chips7.jpg"
/3="Chips8.jpg"
/4="Chips9.jpg"
/5="Chips10.jpg"
/6="Choco6.jpg"
/7="Choco7.jpg"
/8="Choco8.jpg"
/9="Choco9.jpg"
/10="Choco10.jpg"
/11="Yoghurt6.jpg"
/12="Yoghurt7.jpg"
/13="Yoghurt8.jpg"
/14="Yoghurt9.jpg"
/15="Yoghurt10.jpg"
</item>

<list Chips_set2>
/ items = (1,2,3,4,5)
/ selectionrate = always
</list>

<list Chipsitemnumbers2>
/ items = (list.Chips_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list choco_set2>
/ items = (6,7,8,9,10)
/ selectionrate = always
</list>

<list Chocoitemnumbers2>
/ items = (list.choco_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list Yoghurt_set2>
/ items = (11,12,13,14,15)
/ selectionrate = always
</list>

<list Yoghurtitemnumbers2>
/ items = (list.Yoghurt_set2.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<picture b1>
/ items = poolb
/select=values.b1
/size= (50%,50%)
/position=(50%,50%)
</picture>

<list asetnumbers>
/ poolsize = 1
</list>

===========================================================================================
Reference image
============================================================================================

<picture Chipsreference>
/items=("Chips0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Chocoreference>
/items=("Choco0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>

<picture Yoghurtreference>
/items=("Yoghurt0.jpg")
/size= (50%,50%)
/position=(50%,50%)
</picture>



<text questions>
/ items = ("Which one of the pictures has a larger portion?")
/ fontstyle = ("Arial", 5%, false, false, false, false, 5, 1)
/ valign = top
/ halign = center
/ position = (50,20)

</text>

<Text ChoiceA>
/ items = ("Press F= First picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (20,50)
</text>

<Text ChoiceB>
/ items = ("Press J= Second picture")
/ fontstyle = ("Arial", 4.44%, false, false, false, false, 5, 1)
/ valign = center
/ halign = center
/ position = (75,50)

</text>

========================================================================================================
Chips trial
========================================================================================================

<trial Chipsa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chipsitemnumbers1.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chipsb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chipsreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chipsb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chipsitemnumbers2.nextvalue;]
/ stimulustimes = [0=chipsreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>


========================================================================================================
Choco trial
========================================================================================================

<trial Chocoa1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocoa2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.chocoitemnumbers1.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Chocob1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=chocoreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Chocob2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Chocoitemnumbers2.nextvalue;]
/ stimulustimes = [0=chocoreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

========================================================================================================
Yoghurt trial
========================================================================================================

<trial Yoghurta1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=a1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurta2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.Yoghurtitemnumbers1.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=a1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("F")
</trial>

<trial Yoghurtb1>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=b1;2000=clearscreen;2001=Yoghurtreference;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

<trial Yoghurtb2>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.b1 = list.Yoghurtitemnumbers2.nextvalue;]
/ stimulustimes = [0=Yoghurtreference;2000=clearscreen;2001=b1;4000=clearscreen;4001=questions,choiceA,choiceB]
/ beginresponsetime = 4001
/ validresponse = ("F","J")
/ correctresponse = ("J")
</trial>

=================================================================================================================
Break
================================================================================================================

<clock timer>
/ format = "mm:ss"
/ mode = timer
/ erase = false
/ position = (50%, 50%)
/ resetrate = block
/ txbgcolor = black
/ txcolor = white
/ size = (100,100)
/ position = (50,60)
/ timeout = parameters.breaktime
</clock>

<text break>
/items=("Please have a break")
/ fontstyle = ("Arial", 6.67%, false, false, false, false, 5, 1)
</text>

<trial break>
/stimulusframes=[1=break, timer]
/timeout= parameters.breaktime
</trial>

===================================================================================================
Block
======================================================================================================

<block chipsblock>

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2);51=break]
/ preinstructions = (instruction2)
</block>

<block chocoblock>
/ trials = [1-50=noreplace(chocoa1,chocoa2,chocob1,chocob2);51=break]
/ preinstructions = (instruction2)
</block>

<block Yoghurtblock>
/ trials = [1-50=noreplace(Yoghurta1,Yoghurta2,Yoghurtb1,Yoghurtb2);51=break]
/ preinstructions = (instruction2)
</block>

<block practice>
/trials= [1-2=noreplace(chipsa1,chipsb2);3-4= noreplace(chocoa2,chocob2);5-6=noreplace(Yoghurta1,Yoghurtb2)]
/ preinstructions = (instruction1)
</block>


==================================================================================================
Experiment
=================================================================================================

<expt study>
/ blocks = [1=practice; 2-7=noreplace(Chipsblock,Chocoblock,Yoghurtblock)]
</expt>

==================================================================================================
Data
==================================================================================================

<data>
/columns = (build, computer.platform, date, time, subject, group, blockcode, blocknum, trialcode, trialnum,
stimulus,stimulus,stimulus,response, correct, latency)
/ separatefiles = true
</data>


It's not clear to me what specifically you aim to counterbalance. Could you please elaborate?

Also, please don't paste entire scripts into the message body. Instead, please attach the actual script file via +Insert -> Add File to your post. In addition, if your script requires any external files (images), please provide those files as well.

Hi Dave,

I am trying to counterbalance the stimuli image. So, I want participants to see each stimuli image (chips1.jpg-Chips10.jpg) 5 times for each block. With the current script, one of stimuli images can appear more than 5 times or only 3-4 times. Is there a way to make all image will always appear 5 times in one block?

Thank you for your help.


Well, you're running 50 trials in a block

/ trials = [1-50=noreplace(chipsa1,chipsa2,chipsb1,chipsb2)

and you're sampling 4 trial elements in equal proportions. Mathematically, that doesn't quite work? 50/4 = 12.5, and since there can be no such thing as "half a trial," you'll necessarily get random imbalances.

I'm guessing you want to have something where the number of chipsa1 + chipsa2 trials = 25 and same for chipsb1 + chipsb2 trials, resulting in 5x5 presentations of items 1-5 and 6-10 respectively. However, to do this, you would have to decide whether you want to run 12 chipsa1 trials and 13 chipsa2 trials or the reverse. Then enter the requisite amount of each trial into the noreplace() pool in the block's /trials.

Hi Dave,

Thank you for pointing that out. I try make it equal by reducing the number of trial to 40, which means each image should appear 4 times. Some of the image still appear 5 times and other appear 3 times. Please find the attached script.

No, if you only run the chipsblock, you'll get each item sampled exactly 4 times. See the attached data file.

However, since you're sampling items from the various lists during the practice block, you ought to reset those lists at the end of the practice block, otherwise the items that were sampled during the practice block will not be available for sampling at the start of the test blocks -- they will only become available again later, when the lists run out of other items to sample without replacement, at which point all items become available for sampling again. I.e. you'll want to do something like

<block practice>
/ onblockend = [
list.Chipsitemnumbers1.reset();
list.Chipsitemnumbers2.reset();
list.Chocoitemnumbers1.reset();
list.Chocoitemnumbers2.reset();
list.Yoghurtitemnumbers1.reset();
list.Yoghurtitemnumbers2.reset();
]

/trials= [1-2=noreplace(chipsa1,chipsb2);3-4= noreplace(chocoa2,chocob2);5-6=noreplace(Yoghurta1,Yoghurtb2)]
/ preinstructions = (instruction1)
</block>
Hi Dave,

Thank you very much help. It works as I wanted.











GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search