Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

IAT - Presenting Stimuli from 2 Categories Alternately

Hello!

I am trying to set up an IAT on OpenSesame, and I have done a large portion of it. However, for the congruent and incongruent blocks for which participants have to categorize stimuli from 2 different categories (in my case, it would be nationality and ethnicity), and I require the stimuli to appear alternately (e.g., nationality, ethnicity, nationality, ethnicity...).

Is there a simple code I can use to make this happen? I would really appreciate some help!

(Note: this experiment will eventually have to make its way to OSWeb to be conducted online).

Comments

  • Hi @Ashleigh,

    Glad to hear that you've made good progress with your task 👍️

    I'm assuming that this is the task you were referring to in an earlier thread (https://forum.cogsci.nl/discussion/7394/how-to-present-a-random-subset-of-stimuli#latest).

    In OS, you could edit the loop's script in Python and use the constrain command to make sure that two trials of a same type (as identified by a specific variable) don't get repeated. Unfortunately, this method is not supported in OSWeb at present.

    So I'd say that you have to options (though there may be more).

    Option A is coding. You could use Javascript to shuffle your trials and to keep shuffling until the solution fulfills certain conditions (in your case, that consecutive trials are not of the same type). This might be a little tricky, however, as the task might get stuck in generating shuffled lists for a while until one is found that satisfies your conditions.

    An alternative would be to create sub-lists (one for ethnicity trials and another for nationality trials), shuffle these randomly, and then programmatically create a list of trials by assembling the two in an alternating way. So for example, if you have a list of 20 ethnicity trials and 20 nationality trials, you could shuffle each randomly and independently, then build the list of trials by picking the first from the shuffled ethnicity list, then the first from the shuffled nationality list, then the second from the ethnicity list, then the second from the nationality list etc. You would then have, on every trial, to call the appropriate element from that trials list. All of this using code. Depending on how you currently have your task, this may be more or less difficult to implement, but I think it would be an efficient option.

    Option B becomes possible thanks to the latest version of OSWeb (1.4) and would consist in offloading the quasi-randomization to build a series of lists that fulfill your conditions. You'd have to create them outside OS and save them as csv files. OSWeb 1.4 supports external files as a source for loops. So, let's imagine that you've set up a hundred different possible stimuli files that contain the trials in the order you want, you could use some javascript code to pick a random on of these files, and then have the loop load the trials from that file. I publish a post not long ago to demonstrate how to do this:

    https://forum.cogsci.nl/discussion/7413/demo-how-to-parse-a-csv-to-populate-a-loop-osweb-1-4#latest

    This second method just shifts the problems outside OS,though. So, unless you have a way to easily generate lots of csv files, I think that option A is best.

    Hope this helps!

    Fabrice.

    Buy Me A Coffee

Sign In or Register to comment.