Restricted selection of items


Author
Message
Shlomo Hareli
Shlomo Hareli
Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)
Group: Forum Members
Posts: 64, Visits: 225
Hi
I have a pool of a 600 items formed of sets of four so that I would like to choose 4 items randomly without selecting any item belonging to the same set. So assuming I have A1, A2, A3, A4, and, B1 B2, B3, B4 etc. If a certain A is selected, I would want to be able to select any item except for any A and so forth. In other words, I would like to randomly select only one item from each set (four such items in total).  
Thanks for any help
Shlomo

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 103K
So you have a total of 150 sets, each set containing 4 items (600 items total).

What you'll want to do at the beginning of the experiment is to (1) select one of the sets at random (draw a number between 1-150 without replacement), (2) select one of the items in that set (draw a number between 1 and 4 with replacement) and (3) store the result somewhere (e.g. in a counter that you'll use for item selection in the remainder of the task). Repeat that process 4 times.

Here's an example using 8 sets of 4 items; one random item each of 4 randomly chosen sets is selected:

<values>
/ selectedset = 0
/ selecteditem = 0
/ itemsperset = 4
/ myvalue = 1
</values>

<counter selectset>
/ select = noreplace(1-8)
/ selectionrate = always
</counter>

<counter selectiteminset>
/ select = replace(1-4)
/ selectionrate = always
</counter>

<counter mycounter>
/ select = noreplace
</counter>

<expt>
/ onexptbegin = [values.selectedset = counter.selectset.selectedvalue;
    values.selecteditem = counter.selectiteminset.selectedvalue;
    counter.mycounter.item = (values.selectedset-1)*values.itemsperset+values.selecteditem; ]
/ onexptbegin = [values.selectedset = counter.selectset.selectedvalue;
    values.selecteditem = counter.selectiteminset.selectedvalue;
    counter.mycounter.item = (values.selectedset-1)*values.itemsperset+values.selecteditem; ]
/ onexptbegin = [values.selectedset = counter.selectset.selectedvalue;
    values.selecteditem = counter.selectiteminset.selectedvalue;
    counter.mycounter.item = (values.selectedset-1)*values.itemsperset+values.selecteditem; ]
/ onexptbegin = [values.selectedset = counter.selectset.selectedvalue;
    values.selecteditem = counter.selectiteminset.selectedvalue;
    counter.mycounter.item = (values.selectedset-1)*values.itemsperset+values.selecteditem; ]
/ blocks = [1=myblock]
</expt>

<block myblock>
/ trials = [1-4=mytrial]
</block>

<trial mytrial>
/ ontrialbegin = [values.myvalue = counter.mycounter.selectedvalue; ]
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = myitems
/ select = values.myvalue
</text>

<item myitems>
/ 1 = "A1"
/ 2 = "A2"
/ 3 = "A3"
/ 4 = "A4"

/ 5 = "B1"
/ 6 = "B2"
/ 7 = "B3"
/ 8 = "B4"

/ 9 = "C1"
/ 10 = "C2"
/ 11 = "C3"
/ 12 = "C4"

/ 13 = "D1"
/ 14 = "D2"
/ 15 = "D3"
/ 16 = "D4"

/ 17 = "E1"
/ 18 = "E2"
/ 19 = "E3"
/ 20 = "E4"

/ 21= "F1"
/ 22 = "F2"
/ 23 = "F3"
/ 24 = "F4"

/ 25 = "G1"
/ 26 = "G2"
/ 27 = "G3"
/ 28 = "G4"

/ 29 = "H1"
/ 30 = "H2"
/ 31 = "H3"
/ 32 = "H4"
</item>

Shlomo Hareli
Shlomo Hareli
Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)Guru (6.4K reputation)
Group: Forum Members
Posts: 64, Visits: 225
Dear Dave
Thank you very much
Shlomo
erdemozan
erdemozan
Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)
Group: Forum Members
Posts: 5, Visits: 49

Hi,
I actually want to do something similar. What I have in my hand are 24 pictures and 12 words. Each word comes up with each photo only once adding up to 288 trials. The thing that I want to do now is a little bit different. I have 2 different versions of each of the pictures that I have used at the first script, adding up to 48 pictures. I want the script the show only one version of each picture. 

For example if the participant sees the first version of the picture A, s/he will not see the second version of it. There still will be 288 trials, but each participant will see either the first or the second version of each photo randomly selected. 

What I had in mind was to create 24 sets consisting of 2 pictures each and try to apply what Dave has suggested. But it didn't seem that parsimonious in my case. But I cannot seem to figure out another way around it. Would you suggest something that fits better to my experimental design?

Thanks in advance!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 103K
Perhaps give https://www.millisecond.com/forums/FindPost10023.aspx a look, which is a variation on that theme.

erdemozan
erdemozan
Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)
Group: Forum Members
Posts: 5, Visits: 49
Oh, thank you very much! I'll try and figure out whether I can put that in use. It looks like that it's going to work though.

I'll let you know about the results!

Thanks again!
erdemozan
erdemozan
Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)
Group: Forum Members
Posts: 5, Visits: 49
I have tried out what you suggesdted Dave. Thank you very much!

I think I am on the right direction, but I am stuck now. I managed to alter the script to select one version of a given picture. Each picture (a randomly selected version of it) comes up 12 times (as it should be) and each word comes up 24 times (as it should be).

But there are two things that I couldn't succeed at making the script to do.

First: I want the participants to see only one version of a picture. If they see the first version of a picture, they will only see that version for the rest of the experiment. and the version should be randomly selected. Now the script randomly selects the version, but doesn't record the shown version.
Second: Each picture should show up with one word, only one time.

To sum up: A version of a picture should be selected, and each word should come up with this picture only one time.

Thanks everyone in advance, Have a nice day!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 103K
Do something along the following lines: Suppose you have 4 images (2 versions of each image; total of 8) and two words. You first want to eliminate one version of each image at random (cf. the logic in /onblockbegin). There'll be only 4 items left in after that (one randomly selected version of each image item).

<block myblock>
/ onblockbegin = [remove(item.picitems, noreplace(7,8));
    remove(item.picitems, noreplace(5,6));
    remove(item.picitems, noreplace(3,4));
    remove(item.picitems, noreplace(1,2)); ]

/ trials = [1-8=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=picture, word]
/validresponse = (57)
</trial>

<text picture>
/ items = picitems
/ position = (50%, 40%)
/ select = piccounter
</text>

<item picitems>
/ 1 = "A1"
/ 2 = "A2"
/ 3 = "B1"
/ 4 = "B2"
/ 5 = "C1"
/ 6 = "C2"
/ 7 = "D1"
/ 8 = "D2"
</item>

<text word>
/ items = worditems
/ position = (50%, 60%)
/ select = wordcounter
</text>

<item worditems>
/ 1 = "Word 1"
/ 2 = "Word 2"
</item>

<counter piccounter>
/ items = (1,2,3,4,1,2,3,4)
/ select = noreplace
</counter>

<counter wordcounter>
/ items = (1,1,1,1,2,2,2,2)
/ select = current(piccounter)
</counter>

Pair your images and word items via the two above counters, i.e., each of the 4 remaining image items is supposed to be paired with each of the two words once. In this example that results in 4 x 2 = 8 pairs / trials. Extend as needed to your full set of image and word items.

erdemozan
erdemozan
Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)Partner Member (970 reputation)
Group: Forum Members
Posts: 5, Visits: 49
Thank you for your quick reply Dave!

Right now I am trying to do what you say, but I just couldn't get the experiment to run. At first it seemed like a really good idea. But now when the monkey run comes to the part where it needs to select pics, it gives an error usually at the beginning or in one of the few trials.

the error reads: "Unable to initialize <picture AApics> item number 38. Verify that the item exists and is correctly defined"

It gives a different number every time I try, it appears that it cannot find the pictures, I don't know if it is because I have did something wrong while removing the pics. I am trying to adopt your solution to my own experiment. That's probably why cannot make everything work at the same time.



Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 103K
Definitely one or several mistakes in your code. Where exactly those are, I cannot tell you. The error message points the way, though, you've removed item numbers that the script later refers to. Examine the assumptions the script makes about item numbers and work back from there.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search