Howdy, Stranger!

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

Supported by

Multiple groups

Hi all,

I'm currently programming an experiment and I need your help. The structure of the experiment is as follows:
The experiment has 2 different parts and 8 different groups:

Part 1:

Participants are assigned to a experimental or a control group

Part 2:

After they have completed the task participants of both groups are assigned to 1 of 4 tasks

--> This means that there are 8 groups in total: experimental group & Task 1; experimental group & Task 2; experimental group & Task 3; experimental group & Task 4 and control group & Task 1; control group & Task 2; control group & Task 3; control group & Task 4

I need all tasks in 1 file because it would get too messy if I had 8 different excel-sheets. As a consequence I need a code that allows me to separate the participant into 1 of the 8 groups. In the first part participants need to be separated into 2 groups (experimental vs. control condition). Then participants of both groups need to be assigned to 1 of the 4 tasks. In the end each group should entail 10 participants (80 participants in total). I know that it is possible to create a dictionary in python and I was hoping this would help me to separate the participants into different groups. Since I'm just learning to use python I was hoping someone could help me with the code or give me some advice.

Thank you very much,
Erwin

Comments

  • A simple selution is to use mod on the subject number. if 0-3 control, if 4-7 exp.
    A mod of 4 can give you the different groups.

  • Thanks for your answer! I'm not sure if I understand what you exactly mean. Could you go into further detail? In my experiment I need to separate the participants twice in 2 steps: first step = control vs. experimental group and second step = separate participants in both groups into 4 different groups. Is it possible to do this with the mod function?

    Thanks,
    Erwin

  • Hi Erwin.

    The mod function returns the residuals from a division. See here. So if you take the var.subject_nr and take the modulo with 4, you will always get values between 0 and 3. Then, you have to have a matching of condition to ID. So if you have 4 groups, something like that would do:


    if ID == 0: first = 0 second = 0 elif ID == 1: first = 1 second = 0 elif ID == 2: first = 0 second = 1 elif ID == 3: first = 1 second = 1

    Eduard

    Buy Me A Coffee

  • Dear eduard, dear Korem N

    Thanks for your answer! I looked into the modulo function and it certainly seems to be a good solution. However I think the modulo function distributes the participants regularly into the various groups (e.g. 4 participants in group 1 then 4 particpants in group 2 and so on). For my experiment I would like to distribute the participants randomly into the various groups. My solution for this problem is to create an inline_script at the beginning of the experiment where I define the groups:

    var.experimentalgruppe = [1, 2, 5, 6, 7, 8, 11, 12] #this line should separate the participants into 2 groups experimental vs. control
    
    var.aufgabe1 = [1, 7, 12] #the following 4 groups
    var.aufgabe2 = [2, 3, 13] #the following 4 groups
    var.aufgabe3 = [4, 11, 14] #the following 4 groups
    var.aufgabe4 = [5, 8, 15] #the following 4 groups
    
    var.limited_subject_nr = var.subject_nr % 16 #after 16 participants the whole process should be repeated

    Then I would add another inline_script at the end of the experiment:

    if (var.limited_subject_nr in var.experimentalgruppe):
        print('Ego_Depletion_SST_Farbe')
    else:
        print('Ohne_Ego_Depletion')
        
    if (var.limited_subject_nr in var.aufgabe1):
        print('Folgeaufgabe_SST_Ton')
    
    elif (var.limited_subject_nr in var.aufgabe2):
        print('Folgeaufgabe_Stroop')    
        
    elif (var.limited_subject_nr in var.aufgabe3):
        print('Folgeaufgabe_EFT')
    
    else:
        print('Folgeaufgabe_Anagramm')

    These two inline_scripts should separate the participants into the experimental or the control group in the first step and then into one of the 4 groups in the second step. I used the print() function so I can look at the debug window and check if this solution works (it seems that the code works because it prints out the correct groups). Of course the print() function doesn't actually run the tasks so here is my question: How can I tell OpenSesame to run the tasks? I tried the .prepare() and .show() function but that doesn't seem to work. To be clear: let's say participant 11 is doing the experiment - according to my code this participant will get the experimental task in the first step and then task number 3 in the second step. Does this make sense?
    I added my script in the attachment so you can see the structure of the experiment.

    Cheers,
    Erwin

  • Hi Erwin,

    Well, you have to create the task first (What's the task actually?). Did you do that? Maybe have a look at the beginner's tutorial, to get an example of how a cueing experiment would look like. This will give you some inspiration how to implement your own task. http://osdoc.cogsci.nl/3.1/tutorials/beginner/

    Eduard

    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