Random Assignment to 4 groups

163 views
Skip to first unread message

Arturo Heyner Cano Bejar

unread,
Apr 6, 2021, 12:10:34 AM4/6/21
to LIONESS Lab help and discussion
Dear LIONESS Lab Team,

Thank you for this great experimental platform. I am new to LIONESS as much as to JS. I found I could post a question from the FAQs in the LIONESS introduction page. I noticed that most people do experiments involving subjects interactions, however, I am not sure if the program allows for individual level experimentation.

Shortly, I am struggling with the randomly assignment. I would like participants to be randomly assigned to 1 of the 4 conditions I created for my experiment. My first intuition was to create one stage for every experimental condition and then direct participants randomly to any of the four (Please refer to the picture).

Screen Shot 2021-04-06 at 12.03.03.png

The code I have in the picture comes from browsing this forum conversations but I was not lucky in obtaining the results I want.

I would very much appreciate if you could give me a lead on how to assign participants to any but one of the 4 treatments I have.

Thank you in advance!

Arturo

Thomas Dudek

unread,
Apr 6, 2021, 12:19:35 AM4/6/21
to LIONESS Lab help and discussion
Hello Arturo,

Looks like your code assigns the variable randomPartner and randomSet either a 2, or 3? Or am I calculating something wrong? ((2-1)+1) + 1) = 3? 

If you want four treatments randomly, you can use

var randomPartner = 1 + Math.floor(Math.random()*4)  ;
var randomSet = 1 + Math.floor(Math.random()*4)  ;

That should assign everyone randomly a number from 1 to 4. 
Best,
Thomas

Arturo Heyner Cano Bejar

unread,
Apr 6, 2021, 12:46:00 AM4/6/21
to LIONESS Lab help and discussion
Dear Thomas,

Thanks for you quick response, I have tried the code you provided me, however, when testing the experiment;

1. I was only redirected to the control condition, which in the picture above is "stage 4". How could I do to direct participants to any of the four conditions?
2. Am I writing the code in the wrong Stage—stage 2 in my case?
3. Or do I need a lobby stage in this case?

Thank you again!

Bests, 

Arturo

Thomas Dudek

unread,
Apr 6, 2021, 12:54:55 AM4/6/21
to LIONESS Lab help and discussion
Not so easy to answer without being able to enter your experiment.
What's your experiment's name or ID? And have you made your experiment publicly available? 

I suspect that you haven't used buttons with conditions. You will need to create one button per stage to which you want to be directed and show each button conditional on the treatment that a participant is assigned to. 
Conditional shows of buttons can be achieved by using the little button that looks like glasses on the top right side of the button element. 

Thomas

Arturo Heyner Cano Bejar

unread,
Apr 6, 2021, 1:52:50 AM4/6/21
to LIONESS Lab help and discussion
The experiment name "Big Five Copy" and I have just changed it to public.
I implemented the changes regarding the "conditional", but I think I am not lucky today!

I must be doing something wrong here. Thank you for your help!

Thomas Dudek

unread,
Apr 6, 2021, 2:17:11 AM4/6/21
to LIONESS Lab help and discussion
I just looked into your experiment.
You need to create four different buttons, and each button can only have one condition. 
Then, each button must be set up so that it leads to a different next stage. You can select what stage by clicking on the drop-down selection (button) below the "next stage" text. 
One example: You want someone with randomCond==1 to be forwarded to the Control stage. Then you select in the drop-down the Control stage and in the conditional display you only include randomCond==1. 

That should solve it for you. 

Arturo Heyner Cano Bejar

unread,
Apr 6, 2021, 3:02:26 AM4/6/21
to LIONESS Lab help and discussion
Thank you for that!
After using different buttons and adjusting the drow-down menu accordingly , I was still directed to the next stage which is the control stage.

So, I tried changing the nature of the stages designed for the conditions from standard to lobby, but did not work out;
Additionally, I tried defining the conditional (glasses) fo the 4 condition stages and it did not work either.
I was also thinking that maybe chaging the "matching" drop-down menu would help but, it didn't

Thank you!

Thomas Dudek

unread,
Apr 6, 2021, 3:59:06 AM4/6/21
to LIONESS Lab help and discussion
Arturo, you cannot have button in a lobby.
You need to change the stage type into "normal". 
If you want a timer, you can do the same thing I was just suggested doing by Lucas Molleman. 

I made a copy of your experiment named Arturo, where your four treatment assignments and conditional displays of buttons now work as they should. 
It seems that LIONESS has been coded a bit oddly here so that changing from lobby to standard doesn't work -- the system always asks me to first enter a timer because you selected in the lobby to have the timer on. When I do this, I still can't change from lobby to standard. 
Since you made all of your stages a lobby stage, it appears, you will need to create all of these stages again and leave them as a standard stage (do not make them a lobby). 
The lobby is only required if you want more than one participant to form a group. I don't know if that is your goal, but if so, you only do this once in the beginning of the game, and thereafter you would never use a lobby again normally.... 

Cheers,
Thomas

Arturo Heyner Cano Bejar

unread,
Apr 6, 2021, 7:56:19 AM4/6/21
to LIONESS Lab help and discussion
Dear Thomas,

Thank you very much for your time, effort and patience with this question!
Will take a closer look at the file you prepared for me and contact you if I need further guidance.

Thank you again :)

Bests,

Arturo

Reply all
Reply to author
Forward
0 new messages