Randomize combinations in an IAT - builder

I’m stuck on the design of my IAT (target category: gender with male and female names and attribute category: sexually active vs. passive with a list of 8 adjectives).

My idea was as follows: create two IATs to randomize the side (right or left) on which the attribute categories (passive vs. active) are presented, with:

  • IAT 1: active on the left and passive on the right.
  • IAT 2: passive on the right and active on the left.

And so in each IAT I randomize the order of association between gender and passive vs. active with:

  • block_order1: active man + passive woman and then active woman + passive man
  • block_order2: active woman + passive man and then active man + passive woman
    And that’s where I have a problem!

Since I tried adding code at the beginning (setup routine) to randomize the association order (order 1 or 2), my whole test has been bugging out, whereas before it worked fine. The order seems randomized, but during the incong task (active woman + passive man), the stimuli get mixed up, there are adjectives and first names that overlap, and the “s” (for left) and “p” (for right) keys no longer work. I tried to see what ChatGPT suggested to solve this, but it doesn’t work and it ended up going round in circles with its suggestions.

I’m sending you the structure of my bulder and the details of my test, maybe someone will have an idea: ​(I took the demo and modified it to match my test)

In my first routine called setup, I put code to create a block_file that would randomly call either my block_order1 or block_order2 file (adding this code is what caused everything to crash).

My files block_order1 and block_order2 provide a list of blocks to follow in a certain order with:

  • pos_neg_train = attribute practice → classify adjectives as passive or active
  • target_practice = target practice → classify female and male first names
  • cong_train = practice association 1 → 16 attempts to practice classifying first names and adjectives as either male or sexually active or female and sexually passive
  • cong-test = test association 1 → same thing with 48 attempts
  • incong_train = practice association 2 → 16 attempts to practice classifying first names and adjectives as either female and sexually active or male and sexually passive
  • incong-test = test association 2 → same thing with 48 attempt

Since I have 8 adjectives (4 of each) and 8 first names (4M + 4F), that gives me 16 basic trials. To get 48, I multiply by 3 (nReps).

So then I have a loop and an instruction routine that work well, and the same goes for my ready routine that prepares the test:

AND then I have a second loop that calls the block_file file.

and a third loop that encompasses my trial and feedback routine, which calls my conditions from my block_order1 or 2 file

And so here are my cong-test and incong-test files: ​

Since it’s only the incongruent part that isn’t working, I figured it must be my file that’s causing the problem, but everything looks fine. According to ChatGPT, it’s the routine: ready executes before the loop blocks have loaded the Excel line.

Do you have any idea how to fix this please?

Hello @doubletrouble

You provide a lot of information about the setup of your experiment, which is certainly helpful, but it also distracts from your problem to some extent. The problems/errors are not clearly described.

That seems to be one problem. What is the error message? The code that you are using looks ok.

import random
block_file = random.choice(['block_order1.xlsx', 'block_order2.xlsx'])

Are you planning to run the experiment online? If so, this code would not execute.

How can the order be randomised if your experiment crashes? See above.

The overlap of the stimuli seems to be another problem. The non functional keys seem to be another problem.

It would be helpful if you could describe one problem at a time, providing the error message if available and describe what you want to achieve.

Best wishes Jens