Millisecond Forums

Random assignment of pictures once per block

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

By MHWauben - 2/12/2018

Hi,
I am running an experiment in which I’d like four different outcome stimuli to be randomly assigned at the start of a block, used for the duration of that block, and then re-assigned to unused stimuli at the start of the next block, to be used for the duration of that block.
Thus, I’d like four pictures to be selected without replacement from a list of 8, which retain that assignment for one block, and then the remaining four pictures are selected for the next block. At a stretch, I'd also be happy to have two separate lists of 4 pictures, one for each block, where I switch from one to the other at the end of the first block.

Unfortunately, I have only managed to do this using sequential stimulus selection, but not random. I would be grateful for any pointers!

<item outcomes>
/1 = "1.png"
/2 = "2.png"
/3 = "3.png"
/4 = "4.png"
/5 = "5.png"
/6 = "6.png"
/7 = "7.png"
/8 = "8.png"
</item>

<list outcome_selector>
/ items = (1, 2, 3, 4, 5, 6, 7, 8)
/ selectionmode = sequence
/ selectionrate = block
</list>

<picture outcome1>
/items = outcomes
/select = list.outcome_selector.currentvalue
</picture>
<picture outcome2>
/items = ("2.png”,”3.png”,”4.png”,”5.png”,”6.png”,”7.png”,”8.png”,”1.png”)
/select = list.outcome_selector.nextvalue
</picture>
<picture outcome3>
/items = (”3.png”,”4.png”,”5.png”,”6.png”,”7.png”,”8.png”,”1.png”, "2.png”)
/select = list.outcome_selector.nextvalue
</picture>
<picture outcome4>
/items = (”4.png”,”5.png”,”6.png”,”7.png”,”8.png”,”1.png”, "2.png”, ”3.png”)
/select = list.outcome_selector.nextvalue
</picture>

By Dave - 2/13/2018

MHWauben - Monday, February 12, 2018
Hi,
I am running an experiment in which I’d like four different outcome stimuli to be randomly assigned at the start of a block, used for the duration of that block, and then re-assigned to unused stimuli at the start of the next block, to be used for the duration of that block.
Thus, I’d like four pictures to be selected without replacement from a list of 8, which retain that assignment for one block, and then the remaining four pictures are selected for the next block. At a stretch, I'd also be happy to have two separate lists of 4 pictures, one for each block, where I switch from one to the other at the end of the first block.

Unfortunately, I have only managed to do this using sequential stimulus selection, but not random. I would be grateful for any pointers!

<item outcomes>
/1 = "1.png"
/2 = "2.png"
/3 = "3.png"
/4 = "4.png"
/5 = "5.png"
/6 = "6.png"
/7 = "7.png"
/8 = "8.png"
</item>

<list outcome_selector>
/ items = (1, 2, 3, 4, 5, 6, 7, 8)
/ selectionmode = sequence
/ selectionrate = block
</list>

<picture outcome1>
/items = outcomes
/select = list.outcome_selector.currentvalue
</picture>
<picture outcome2>
/items = ("2.png”,”3.png”,”4.png”,”5.png”,”6.png”,”7.png”,”8.png”,”1.png”)
/select = list.outcome_selector.nextvalue
</picture>
<picture outcome3>
/items = (”3.png”,”4.png”,”5.png”,”6.png”,”7.png”,”8.png”,”1.png”, "2.png”)
/select = list.outcome_selector.nextvalue
</picture>
<picture outcome4>
/items = (”4.png”,”5.png”,”6.png”,”7.png”,”8.png”,”1.png”, "2.png”, ”3.png”)
/select = list.outcome_selector.nextvalue
</picture>


You can achieve this by setting up a bunch of global variables (<values>, one per outcome) and then assigning a random item number to each /onblockbegin from a <list>:

<values>
/ outcome1item = 1
/ outcome2item = 1
/ outcome3item = 1
/ outcome4item = 1
</values>

<block myblock>
/ onblockbegin = [
    values.outcome1item = list.outcome_selector.nextindex;
    values.outcome2item = list.outcome_selector.nextindex;
    values.outcome3item = list.outcome_selector.nextindex;
    values.outcome4item = list.outcome_selector.nextindex;
]
</block>


<item outcomes>
/1 = "1.png"
/2 = "2.png"
/3 = "3.png"
/4 = "4.png"
/5 = "5.png"
/6 = "6.png"
/7 = "7.png"
/8 = "8.png"
</item>

<list outcome_selector>
/ poolsize = 8
/ selectionrate = always
</list>

<picture outcome1>
/items = outcomes
/select = values.outcome1item
</picture>
<picture outcome2>
/items = outcomes
/select = values.outcome2item
</picture>
<picture outcome3>
/items = outcomes
/select = values.outcome3item
</picture>
<picture outcome4>
/items = outcomes
/select = values.outcome4item
</picture>