random assignment of pictures by participant


random assignment of pictures by participant

Author
Message
Robert Balas
Robert Balas
Distinguished Member
Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)

Group: Forum Members
Posts: 38, Visits: 85
Hi there,

I've got an issue.
I have two sets of pictures: affective and neutral (4 pics in each class). What I have to do is to randomly assign affective to neutral pics. But, those once assigned pics must be kept constant for each participant, because I have to present each pair of pics multiple times (in random order) for each participant.

I assume that such random assignment should be done once only in the experiment (each new participant engages in a new experimental session). Am I right?

I do not have slightest idea how to do that. Can you help me out with this?

All the best,
Robert
Dave
Dave
Supreme Being
Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
Hmm, maybe there's an easier way that I'm not seeing right now, but here's what I would do to pull this off. First, set up two picture elements and tie them together using the 'current' option in '/ select':

<picture affective_pics>
/ items = affective_pics
/ select = noreplace
[...]
</picture>

<picture neutral_pics>
/ items = neutral_pics
/ select = current(affective_pics)
[...]
</picture>

Next set up two corresponding <item> elements to draw from. The key here is to leave these *empty*:


<item affective_pics>
</item>

<item neutral_pics>
</item>

Then, define two <counter> elements that contain the actual *names* of the picture files you're going to use:

<counter setup_affective_pics>
/ items = ("affective_pic01.jpg", "affective_pic02.jpg", "affective_pic03.jpg", "affective_pic04.jpg")
/ select = noreplace
/ selectionrate = trial
</counter>

<counter setup_neutral_pics>
/ items = ("neutral_pic01.jpg", "neutral_pic02.jpg", "neutral_pic03.jpg", "neutral_pic04.jpg")
/ select = noreplace
/ selectionrate = trial
</counter>

Finally, define a dummy trial that draws from these counters and thus populates the empty <item> elements.

<trial setup_pairings>
/ ontrialbegin = [item.affective_pics.item=counter.setup_affective_pics.selectedvalue]
/ ontrialbegin = [item.neutral_pics.item=counter.setup_neutral_pics.selectedvalue]
/ trialduration = 0
</trial>

At the onset of the experiment, run the dummy trial four times. Lo and behold, you'll have randomly generated affective-neutral pairings that will be kept constant accross the entire experiment.

Check out the attached file for a working demonstration.

Best wishes from a fellow Inquisit user,
~Dave



Attachments
RBalas.zip (206 views, 34.00 KB)
Robert Balas
Robert Balas
Distinguished Member
Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)

Group: Forum Members
Posts: 38, Visits: 85
Dave,

Works great! Thank you.

Best,
Robert
Georg
Georg
Associate Member
Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)

Group: Forum Members
Posts: 1, Visits: 3

Hi Dave, I have the same problem as RBalas. I tried the elements you described and at least I got them right in the sense that Inquisit does not complain. But I still have not solved the problem - the CS are still randomly assigned to the US withing the same participant. I probably did something wrong in one of the other elements. Unfortunately I could not open the script you attached. I guess that's what will solve my problem: I probably should only see an entire script that works so I can see what I did wrong within the other elements... Is your script still online? As I said I could not open it. Or is there anonther script that does the same?


Thank you and Greetings


Georg


Dave
Dave
Supreme Being
Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K

Unfortunately I do not have the script around anymore. However, the instructions in the original reply should be sufficient to get you going. I recommend you first reproduce those in a minimal test case script, then extend / apply to your own procedure.


Regards,


~Dave


st2pa
st2pa
Esteemed Member
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)

Group: Forum Members
Posts: 36, Visits: 19

Hello,


I was hoping someone could help me with a related problem to the one addressed in this post.  


In my study, I have 20 faces of White people and 20 faces of Black people.  Furthermore, I have 20 applications that should be 'accepted', and 20 that should be 'rejected'.  I would need to randomly generate pairings of 10 White/Accept, 10 White/Reject, 10 Black/Accept, 10 Black/Reject.


Furthermore, those pairings need to be created once at the beginning of the study so that participants can be shown them very quickly so as to see the full applicant pool, and then later those same pairings need to be shown again so the participant can make accept/reject decisions for each application/image pairing.  The code above was able to get me started, but I am pretty stumped.  Here is what I have.  Any suggestions would really help me out:


<picture face_pics>
/ items = face_pics
/ select = noreplace
[...]
</picture>

<picture application_pics>
/ items = application_pics
/ select = current(face_pics)
</picture>


<item face_pics>
</item>

<item application_pics>
</item>


Then, I made counters for each of the White, Black, Accept, Reject stimuli.


<counter setup_white_pics>


/ items = ("W1.bmp", "W2.bmp", "W3.bmp", "W4.bmp","W5.bmp","W6.bmp","W7.bmp","W8.bmp","W9.bmp","W10.bmp","W11.bmp", "W12.bmp", "W13.bmp", "W14.bmp","W15.bmp","W16.bmp","W17.bmp","W18.bmp",W19.bmp","W20.bmp")


/ select = noreplace


/ selectionrate = trial


</counter>


<counter setup_black_pics>


/ items = ("B1.bmp", "B2.bmp", "B3.bmp", "B4.bmp","B5.bmp","B6.bmp","B7.bmp","B8.bmp","B9.bmp","B10.bmp","B11.bmp", "B12.bmp", "B13.bmp", "B14.bmp","B15.bmp","B16.bmp","B17.bmp","B18.bmp",B19.bmp","B20.bmp")


/ select = noreplace


/ selectionrate = trial


</counter>


<counter setup_accept_pics>


/ items = ("Accept1.bmp", "Accept2.bmp", "Accept3.bmp", "Accept4.bmp","Accept5.bmp","Accept6.bmp","Accept7.bmp","Accept8.bmp","Accept9.bmp","Accept10.bmp","Accept11.bmp", "Accept12.bmp", "Accept13.bmp", "Accept14.bmp","Accept15.bmp","Accept16.bmp","Accept17.bmp","Accept18.bmp",Accept19.bmp","Accept20.bmp")


/ select = noreplace


/ selectionrate = trial


</counter>


<counter setup_reject_pics>


/ items = ("Reject1.bmp", "Reject2.bmp", "Reject3.bmp", "Reject4.bmp","Reject5.bmp","Reject6.bmp","Reject7.bmp","Reject8.bmp","Reject9.bmp","Reject10.bmp","Reject11.bmp", "Reject12.bmp", "Reject13.bmp", "Reject14.bmp","Reject15.bmp","Reject16.bmp","Reject17.bmp","Reject18.bmp",Reject19.bmp","Reject20.bmp")


/ select = noreplace


/ selectionrate = trial


</counter>


Then I made trial setup pairings for each of the four combinations


trial setup_pairingsaw>


/ ontrialbegin = [item.face_pics.item=counter.setup_white_pics.selectedvalue]


/ ontrialbegin = [item.application_pics.item=counter.setup_accept_pics.selectedvalue]


/ trialduration = 0


/ recorddata = false


</trial>


<trial setup_pairingsrw>


/ ontrialbegin = [item.face_pics.item=counter.setup_white_pics.selectedvalue]


/ ontrialbegin = [item.application_pics.item=counter.setup_reject_pics.selectedvalue]


/ trialduration = 0


/ recorddata = false


</trial>


<trial setup_pairingsab>


/ ontrialbegin = [item.face_pics.item=counter.setup_black_pics.selectedvalue]


/ ontrialbegin = [item.application_pics.item=counter.setup_accept_pics.selectedvalue]


/ trialduration = 0


/ recorddata = false


</trial>


<trial setup_pairingsrb>


/ ontrialbegin = [item.face_pics.item=counter.setup_black_pics.selectedvalue]


/ ontrialbegin = [item.application_pics.item=counter.setup_reject_pics.selectedvalue]


/ trialduration = 0


/ recorddata = false


</trial>


<block pairings>


/ trials = [1-40=noreplace(setup_pairingsaw, setup_pairingsrw, setup_pairingsab, setup_pairingsrb)]


</block>


Finally, I created trials and blocks for the initial 'Orientation' and the final 'Testing' session.


<trial orientaw>


/ stimulusframes = [1=app_pics,image_pics]


/timeout=500


</trial>


<trial orientrw>


/ stimulusframes = [1=app_pics,image_pics]


/timeout=500


</trial>


<trial orientab>


/ stimulusframes = [1=app_pics,image_pics]


/timeout=500


</trial>


<trial orientrb>


/ stimulusframes = [1=app_pics,image_pics]


/timeout=500


</trial>


<block orient>


/ trials = [1-40=noreplace(orientab,orientrb,orientaw,orientrw)]


</block>


<trial testab>


/ stimulusframes = [1=app_pics,AcceptButton,RejectButton,image_pics]


/ validresponse = (AcceptButton,RejectButton)


/timeout=100


</trial>


<trial testrb>


/ stimulusframes = [1=app_pics,AcceptButton,RejectButton,image_pics]


/ validresponse = (AcceptButton,RejectButton)


/timeout=100


</trial>


<trial testaw>


/ stimulusframes = [1=app_pics,AcceptButton,RejectButton,image_pics]


/ validresponse = (AcceptButton,RejectButton)


/timeout=100


</trial>


<trial testrw>


/ stimulusframes = [1=app_pics,AcceptButton,RejectButton,image_pics]


/ validresponse = (AcceptButton,RejectButton)


/timeout=100


</trial>


<block test>


/ trials = [1-40=noreplace(testab,testrb,testaw,testrw)]


</block>


<expt >


/blocks =  [1=pairings;2=orient; 3=test]


</expt>



This really isn't working and I am pretty stuck. Thanks for your help.





Dave
Dave
Supreme Being
Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K

This really isn't working


#1: It would be helpful if you actually could elaborate on what isn't working. A blanket statement doesn't give anyone anything to work with.


#2: There are inconsistencies in the code you posted which make it impossible to figure anything out. For example, you give


<picture face_pics>
/ items = face_pics
/ select = noreplace
[...]
</picture>

<picture application_pics>
/ items = application_pics
/ select = current(face_pics)
</picture


but then reference completely different <picture> elements in your code:



<trial testab>


/ stimulusframes = [1=app_pics,AcceptButton,RejectButton,image_pics]


/ validresponse = (AcceptButton,RejectButton)


/timeout=100


</trial>



#3: All your trials sample from those same <picture> elements:



<trial orientaw>


/ stimulusframes = [1=app_pics,image_pics]


/timeout=500


</trial>


<trial orientrw>


/ stimulusframes = [1=app_pics,image_pics]


/timeout=500


</trial>


<trial orientab>


/ stimulusframes = [1=app_pics,image_pics]


/timeout=500


</trial>


<trial orientrb>


/ stimulusframes = [1=app_pics,image_pics]


/timeout=500


</trial>



These contain *the complete set* of 40 pairings you set up. There is no reason why e.g <trial orientaw> should sample an 'accept/white' pairing from this pool of 40 pairings. If you want your trials to do this, you need to write stuff to separate elements and have the respecitve trial use the "correct" ones.


st2pa
st2pa
Esteemed Member
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)

Group: Forum Members
Posts: 36, Visits: 19

I apologize for my inconsistencies-- I was trying to reformat the code to make it easier to understand.  Below is my attempt to solve the problem by specifying different picture and trial types, but it is still not giving me exactly what I am looking for.  


Within both the orientation and the test blocks, each face and each application only appears once, which is good.  The error comes in these face-application pairings not repeating themselves across blocks.  Thanks for your help...



<picture AcceptButton>


/items = ("Accept.jpg")


/ position = (75%,80%)


/size = (16%,16%)


</picture>


<picture RejectButton>


/items = ("Reject.jpg")


/ position = (25%,80%)


/size = (16%,16%)


</picture>


<picture accept_pics>


/ items = accept_pics


/ select = noreplace


</picture>


<picture reject_pics>


/ items = reject_pics


/ select = noreplace


</picture>


<picture white_pics>


/ items = white_pics


/ select = noreplace


</picture>


<picture black_pics>


/ items = black_pics


/ select = noreplace


</picture>


<item white_pics>


</item>


<item accept_pics>


</item>


<item black_pics>


</item>


<item reject_pics>


</item>


<counter setup_white_pics>


/ items = ("W1S.bmp", "W2S.bmp", "W3S.bmp", "W4S.bmp",


"W5S.bmp", "W6S.bmp", "W8S.bmp", "W9S.bmp",


"W11S.bmp", "W13S.bmp", "W19S.bmp", "W20S.bmp",


"W21S.bmp", "W23S.bmp", "W25S.bmp", "W26S.bmp",


"W28S.bmp", "W30S.bmp", "W31S.bmp", "W37S.bmp")


/ select = noreplace


/ selectionrate = trial


</counter>


<counter setup_black_pics>


/ items = ("B1S.bmp", "B2S.bmp", "B3S.bmp", "B4S.bmp",


"B5S.bmp", "B6S.bmp", "B8S.bmp", "B9S.bmp",


"B10S.bmp", "B12S.bmp", "B984S.bmp", "B985S.bmp",


"B986S.bmp", "B987S.bmp", "B988S.bmp", "B990S.bmp",


"B991S.bmp", "B993S.bmp", "B994S.bmp", "B997S.bmp")


/ select = noreplace


/ selectionrate = trial


</counter>


<counter setup_accept_pics>


/ items = ("App14_1Template.jpg", "App14_2Template.jpg", "App14_3Template.jpg", "App14_4Template.jpg",


"App14_5Template.jpg", "App14_6Template.jpg", "App14_7Template.jpg", "App14_8Template.jpg",


"App14_9Template.jpg", "App14_10Template.jpg", "App14_11Template.jpg", "App14_12Template.jpg",


"App14_13Template.jpg", "App14_14Template.jpg", "App14_15Template.jpg", "App14_16Template.jpg",


"App14_17Template.jpg", "App14_18Template.jpg", "App14_19Template.jpg", "App14_20Template.jpg")


/ select = noreplace


/ selectionrate = trial


</counter>


<counter setup_reject_pics>


/ items = ("App13_1Template.jpg", "App13_2Template.jpg", "App13_3Template.jpg", "App13_4Template.jpg",


"App13_5Template.jpg", "App13_6Template.jpg", "App13_7Template.jpg", "App13_8Template.jpg",


"App13_9Template.jpg", "App13_10Template.jpg", "App13_11Template.jpg", "App13_12Template.jpg",


"App13_13Template.jpg", "App13_14Template.jpg", "App13_15Template.jpg", "App13_16Template.jpg",


"App13_17Template.jpg", "App13_18Template.jpg", "App13_19Template.jpg", "App13_20Template.jpg")


/ select = noreplace


/ selectionrate = trial


</counter>


<trial setup_pairingsaw>


/ ontrialbegin = [item.white_pics.item=counter.setup_white_pics.selectedvalue]


/ ontrialbegin = [item.accept_pics.item=counter.setup_accept_pics.selectedvalue]


/ trialduration = 0


/ recorddata = false


</trial>


<trial setup_pairingsrw>


/ ontrialbegin = [item.white_pics.item=counter.setup_white_pics.selectedvalue]


/ ontrialbegin = [item.reject_pics.item=counter.setup_reject_pics.selectedvalue]


/ trialduration = 0


/ recorddata = false


</trial>


<trial setup_pairingsab>


/ ontrialbegin = [item.black_pics.item=counter.setup_black_pics.selectedvalue]


/ ontrialbegin = [item.accept_pics.item=counter.setup_accept_pics.selectedvalue]


/ trialduration = 0


/ recorddata = false


</trial>


<trial setup_pairingsrb>


/ ontrialbegin = [item.black_pics.item=counter.setup_black_pics.selectedvalue]


/ ontrialbegin = [item.reject_pics.item=counter.setup_reject_pics.selectedvalue]


/ trialduration = 0


/ recorddata = false


</trial>


<trial orientaw>


/ stimulusframes = [1=accept_pics,white_pics]


/timeout=500


</trial>


<trial orientrw>


/ stimulusframes = [1=reject_pics,white_pics]


/timeout=500


</trial>


<trial orientab>


/ stimulusframes = [1=accept_pics,black_pics]


/timeout=500


</trial>


<trial orientrb>


/ stimulusframes = [1=reject_pics,black_pics]


/timeout=500


</trial>


<trial testaw>


/ stimulusframes = [1=accept_pics,AcceptButton,RejectButton,white_pics]


/ correctresponse = (AcceptButton)


/ validresponse = (AcceptButton,RejectButton)


</trial>


<trial testrw>


/ stimulusframes = [1=reject_pics,AcceptButton,RejectButton,white_pics]


/ correctresponse = (RejectButton)


/ validresponse = (AcceptButton,RejectButton)


</trial>


<trial testab>


/ stimulusframes = [1=accept_pics,AcceptButton,RejectButton,black_pics]


/ correctresponse = (AcceptButton)


/ validresponse = (AcceptButton,RejectButton)


</trial>


<trial testrb>


/ stimulusframes = [1=reject_pics,AcceptButton,RejectButton,black_pics]


/ correctresponse = (RejectButton)


/ validresponse = (AcceptButton,RejectButton)


</trial>


<block pairings>


/ trials = [1-40=noreplace(setup_pairingsaw,setup_pairingsrw,setup_pairingsab,setup_pairingsrb)]


</block>


<block orient>


/ trials = [1-40=noreplace(orientaw,orientrw,orientab,orientrb)]


</block>


<block test>


/ trials = [1-40=noreplace(testaw,testrw,testab,testrb)]


</block>


Dave
Dave
Supreme Being
Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K

The error comes in these face-application pairings not repeating themselves across blocks


If you want selection pools to be maintained across blocks, you need to make use of the /resetinterval attribute. Details can be found in the documentation.


However, given that you have 40 pairings *and* each block runs 40 trials (i.e. exhausts all of the pairings), how could they possibly *not* repeat???


st2pa
st2pa
Esteemed Member
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)

Group: Forum Members
Posts: 36, Visits: 19

I am sorry for not being clearer.  I would like the face-application pairings to repeat themselves across blocks.  That is, the combinations that occur during the orientation block (for example, the fifth White face and second Reject application) should also occur during the testing block.  Altering the resetinterval attribute does not appear to be maintaining the combinations.



GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search