Howdy, Stranger!

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

Supported by

Randomize and display two implicit association tests (IATs) from a pool of six IATs

Hi all,

 

I need some help with my IAT study. I have already done a study using a template of the IAT by Pinus and Bar-Anan (2017), which can be found at:

https://doi.org/10.17605/OSF.IO/V8YAJ

 

In my current study, I want to use this IAT six times, each time with a different theme (e.g., age, gender, etc.). In doing so, all six IATs (A-F) should be contained in one opensesame file. From this pool of six IATs, two IATs (e.g., A-F, E-B, D-C, F-A, etc.) should be randomly presented to the subjects. Since I am not an expert in programming with Python, I wanted to ask if anyone has ideas on how to solve my randomization problem?

 

Thanks in advance for your help.

Comments

  • Hi @Sabrina,

    I'm assuming that your 6 versions correspond to 6 distinct loops and that the trial sequence is otherwise identical in all versions (and so that you're using the same trial sequence and linked copies of the obkects within it).

    The simplest way to achieve what you want is to write some code at the beginning of your task to randomly pick 2 values within an array formed by the numbers 1 to 6. Store the first one in a variable you could call task1 and tghe second in a variable task2. Let's imagine that task1 = 2 and task2 = 5. Then all you have to do is to make sure to encapsulate all 6 loops within a higher-level sequence and use the "run if" condition of the objects in that loop to run Loop1 if task1 = 1 or task2 = 1, the same with loop2 (to run if task1=2 or task2=2), etc. This way, only loops 2 and 5 will be presented to participants.

    Python code such as this one should work:

    import random
    while True:
      vars.task1 = random.randint(1, 6)
      vars.task2 = random.randint(1, 6)
       
      if vars.task1 != vars.task2:
        break
    

    Note that if you plan to run the task in a broawer, you'll need to use Javascript code to achieve the same result, not Python (as OSWeb does not support Python).

    Hope this helps,

    Fabrice.

    Buy Me A Coffee

  • Hi Fabrice,

    thanks for your quick reply. However, I realized that I can't try your solution yet, because another problem appeared. Namely, in the template before the IAT sequence, there are two inline_script_items with python code. In one (named "edit_this") you can adjust the stimulus material and the other (named "do_not_edit_this") contains important settings about the IAT. It's probably naive, but I thought that if I integrate the two inline_script_items with the IAT sequence into a new sequence, then I can include six ITAs one after the other this way (using the same trial sequence and linked copies of the objects within it). Unfortunately, I get error messages, such as that variables do not exist. However, this can't be because if I just play an IAT according to the structure in the template, then the IAT works without problems. So I think it has to do with the python code in the two inline_script_items and their position. However, I don't understand enough about programming to know what I need to change to get six IATs integrated into this template. Can you help me with this as well.

    Additionally, I wanted to ask if your code for randomization also ensures that subjects do not get the same IAT twice?

    Thanks for your response in advance.

    Sabrina

  • Hi @Sabrina,

    Had not seen your replied. When replying in the forum, it is best to use handlers (start by typing "@" then the first few letters of your correspondent to select them from a drop-down menu). That wy, your correspondent gets notified that a message is there.

    I don't really follow you description. I do not know what task your are referrting to exactxly (an IAT task can be programmed in multiple ways). It sounds as if you're starting from abn existing task and mofiying it. My advice is to take the time needed to really understand what each bit of the existing program doesm get familiar with Open Sesame, and then try modifications (small ones, little by little). I can't comment about the two lines of Python you're referring to because it entirely depends on what they contain, what they do and in what context. the error message indicates what's wrong: some variable iscalled that has not been defince yet at the timne the code is executed.

    You may want to print your key variables to the console. It's a easy way to keep track of what your program does and it can help detect where problems come from.

    Regarding the code I sent you, yes, it makes sure that two different tasks are selected> if you look carefully at the code you-ll see that this condition is implemente. the "while" loop will run until it is broken and it gets broken when vars.task1 and vars.task2 do not have the same value. (You might wantot read up a little on Python, at leasts the basics such as the "if", "while" functions. It'll come handy when you write your own code.

    Hope this helps,

    Fabrice.

    Buy Me A Coffee

  • @Fab

    Hi, thanks for the tips and the explanation. The template I am talking about can be found here:

    https://doi.org/10.17605/OSF.IO/V8YAJ

    Maybe you can take a look at it if it is not too much bother for you. The problem is that the IAT sequence is preceded by two inline_script_items with python code that is very complex and not so easy to understand even if one tries.

    I thought I could put the IAT sequence and the two inline_script_items into a new sequence to integrate this sequence six times linked, but this does not work. I appreciate any tips so I can keep trying until it works, just running out of ideas.

    Thanks a lot

    Sabrina

  • Hi @Sabrina,

    My recommendation woudl be to start from scratch rather than trying to retrofit an experiment designed with another structure and incluing quite a bit of Python code. I would start by building a simple IAT task, using Javascript if needed, and then when you get it to work properly, add in the different loops for the different versions of the IAT you want to use (anduse the soiution I suggested earlier to select two at random and present only those).

    Hope this helps,

    Fabrice.

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games