Howdy, Stranger!

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

Supported by

[OS web, Java] Counterbalancing stimuli for three groups of participants

Dear all,

My experiment has three blocks of stimuli. Since there are specific conditions across the three blocks, I physically divided them for my convenience, as in the screenshot.

I have to present my blocks in the orders of A→B→C, B→C→A, and C→A→B to three groups of participants.

Is there any way I can implement this in JavaScript?

Thank you so much in advance.


Comments

  • FabFab
    edited July 17

    Hi @Soan,

    If you're gonna run your OSWeb experiment on a JATOS server, please note that you cannot make sure that the same number of participants will be allocated to each of the three orders. Instead, the task will allocate random a subject number base on the OSWeb settings of your experiment:

    Here I set it up to be 0, 1 or 2.

    If you're gonna run the task in the browser but in the lab and introduce yourself the subject number, then you can of course use whatever subject number you'd like for each particiapnt and set your task to use that number to select one of the three condition orderings.

    The key is to include the three loops within a higher level loop that has its number of cycles set to 3:


    You then need to use some javascript coding in an inline_javascript object to declare a few variables and a list contaning the possible ordering of the conditions (corresponding for example to loops called A, B and C). that code must run at the very start of the experiment, so before the higher level loop and preferably in the "prepare" section of the inline_javascript object:

    // Define all possible block orders
    block_orders = [
    ['A', 'B', 'C'],
    ['B', 'C', 'A'],
    ['C', 'A', 'B']
    ];
    // Compute which order to use, cycling through possibilities
    order_index = subject_nr % block_orders.length;
    // Store the chosen order in a global variable
    chosen_block_order = block_orders[order_index];
    // sets up the current_block variables
    block=0
    current_block=0
    


    order_index = subject_nr % block_orders.length uses something called the mod funciton:

    In programming, the modulo (or "mod") operation, often represented by the symbol % (e.g., a % b), calculates the remainder of a division. It returns the value left over after dividing one number (the dividend) by another (the divisor). For example, 7 % 3 would result in 1, because 7 divided by 3 is 2 with a remainder of 1.  This basically ensures to chose one of the possible orders contained in block_orders based on the subject number (0, 1 or 2, whatever the subject number is).

    You can then store that order in a global variable, the index of which we'll later navigate to know which block (A, B or C) should be shown.

    chosen_block_order = block_orders[order_index]

    Finally, notive that we set a block number to 0 and also declare a current_block variable by setting it to nothing ('').

    Then, in the first step of the higher level loop, we need to set the value of the current block depending on what block number we're in. So, if the order picked for the subject is B-C-A and we're at block 0, the current block would be B.

    current_block = chosen_block_order[block]
    

    At the end of the higher level loop, we need a little more code to increment the block variabe by one unit:

    block ++
    

    Finally, we need to set "Run if" conditions for the higher_sequence:

    Now we have everythgin ready. If the order picked for a subject is C-B-A, the value of the curent_block the first time (out of 3 cycles) that the higher_sequence runs will be C, then when it runs a second time it will be B, and on the third and last run it will be A.

    The "run if" conditions ensure that although we reapet the higher_sequence 3 times, only one block will be run each time.

    I attach my example. It should give you the basis you need for your experiment.If you're not familiar with Open Sesame or the basic javascript coding used here, take some time to go through it in order to understand what each bit does and that you understand the logic of the whole method. Then feel free to modify it to suit your needs.

    Finally, note that if you are planning to run the experiment online through JATOS and want eual number of subjects for each order of conditions, the only thing that comes to mind would be to create 3 separate versions of your task where the order is fixed, and then distribute the corresponding links among the participants you recruited. That way you'd have some better control over how many subjects actually do each of the orders.

    Hope this helps.

    Best,

    Fabrice.

    PS: Please acknowledge reception of this message so that I know you've seen and I can then move this thread to the forum dedicated to OSWeb.

    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