Limesurvey Version: Web application, version 3.27.4
Dear Community,
I am struggling with php's random number generator, rand(). It doesn't seem to be behaving as it should.
What I am doing is, creating three allocation variables, each randomly storing either a zero or a one, based on which participants are independently assigned to a control and a treatment groups for three different question tasks. The three allocation variables are each hidden equations in the same question group, coded groupIDsocial1, groupIDsocial2 and groupIDframing, and each with the question text {rand(1,2) - 1}.
These are later used to assign participants to control and treatment groups, e.g. using "Relevance equations" ((!is_empty(groupIDsocial1.NAOK) && (groupIDsocial1.NAOK == 1)))) for treatment (or == 0 for control)). While the assignment by the relevance equations works fine, the pattern of the three random number generators is strange to me.
I activated the survey and tested the whole procedure twice and everything worked for me. My three assignment variables in the two trials were:
- Run: groupIDsocial1 = 0, groupIDsocial2 = 0 and groupIDframing = 1
- Run: groupIDsocial1 = 0, groupIDsocial2 = 1 and groupIDframing = 1
Since everything else seemed to be working well, I ran the survey with paid participants who received very strange random number patterns:
- Participant: groupIDsocial1 = 0, groupIDsocial2 = 0 and groupIDframing = 0
- Participant: groupIDsocial1 = 0, groupIDsocial2 = 0 and groupIDframing = 0
- Participant: groupIDsocial1 = 0, groupIDsocial2 = 0 and groupIDframing = 0
- Participant: groupIDsocial1 = 1, groupIDsocial2 = 1 and groupIDframing = 1
- Participant: groupIDsocial1 = 1, groupIDsocial2 = 1 and groupIDframing = 1
- Participant: groupIDsocial1 = 0, groupIDsocial2 = 0 and groupIDframing = 0
- Participant: groupIDsocial1 = 1, groupIDsocial2 = 1 and groupIDframing = 1
I mean, it is possible, but unlikely, to get this pattern.... So I stopped the procedure at seven participants and made a new approach by putting each of the three allocation variables into their own question groups (with nothing in them but the respective hidden allocation equation). Then again my own two first attempts:
- Run: groupIDsocial1 = 0, groupIDsocial2 = 0 and groupIDframing = 1
- Run: groupIDsocial1 = 0, groupIDsocial2 = 1 and groupIDframing = 0
Since it seemed to be okay again, I started the experiment again with five real participants who received the following allocation values:
- Participant: groupIDsocial1 = 1, groupIDsocial2 = 1 and groupIDframing = 1
- Participant: groupIDsocial1 = 1, groupIDsocial2 = 1 and groupIDframing = 0
- Participant: groupIDsocial1 = 1, groupIDsocial2 = 1 and groupIDframing = 0
- Participant: groupIDsocial1 = 1, groupIDsocial2 = 1 and groupIDframing = 1
- Participant: groupIDsocial1 = 1, groupIDsocial2 = 1 and groupIDframing = 0
Is it just me or is there something wrong here? Am I wrong and everything is fine and I was just super unlucky? Or maybe someone has an idea how to get rand() to generate really randomly? I am very pleased with how well the relevance equation works in conjunction with the hidden control and treatment assignment equation for a single task (has always worked in the past), so I am very confused why I am not able to make it work for three different C/T assignments...
My next approach would be to use rand(1,2), rand(3,4) and rand(5,6) for the three hidden equations. But unfortunately, I'm running out of money and don't have many experiments left..
Let me know if I should explain more. Thank you very much for your time!