- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Randomly assign participants to differnet question groups
- Ellaisa
- Topic Author
- Offline
- New Member
Less
More
5 years 2 months ago #179936
by Ellaisa
Randomly assign participants to differnet question groups was created by Ellaisa
Hello everyone,
I tried to randomly assign participants to differnet question groups.
I have created 2 different szenarios within 2 different questiongroups. Some people should see szenario 1 and the other szenario 2.
Therefore I created a question group (that is always hidden) including in one question the randomization with: if(is_empty(randnumber.NAOK), rand(1, 2), randnumber.NAOK) - question type is equation
Now I have created another question group, that is my first szenario. In the relevance euqation I have added: randnumber == "1"
Afterwards my questions for this szenario follow.
I have done the same with szenario number 2, only changed: randnumber == "2"
I tought that this should lead to a 50/50 randomization. Now I have started a pretest and I mostly offers szenario 1 (85% of participants).
Can anyone tell me what I have done wrong or could do better?
Thanks a lot!
I tried to randomly assign participants to differnet question groups.
I have created 2 different szenarios within 2 different questiongroups. Some people should see szenario 1 and the other szenario 2.
Therefore I created a question group (that is always hidden) including in one question the randomization with: if(is_empty(randnumber.NAOK), rand(1, 2), randnumber.NAOK) - question type is equation
Now I have created another question group, that is my first szenario. In the relevance euqation I have added: randnumber == "1"
Afterwards my questions for this szenario follow.
I have done the same with szenario number 2, only changed: randnumber == "2"
I tought that this should lead to a 50/50 randomization. Now I have started a pretest and I mostly offers szenario 1 (85% of participants).
Can anyone tell me what I have done wrong or could do better?
Thanks a lot!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
5 years 2 months ago #179937
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Randomly assign participants to differnet question groups
What is your sample size? The larger the sample size, the closer you will get to 50/50.
You might also try:
And then use relevance:
You might also try:
Code:
if(is_empty(randnumber.NAOK), rand(1, 100), randnumber.NAOK)
And then use relevance:
Code:
intval(randnumber) < 51
Code:
intval(randnumber) > 50
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Ellaisa
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
5 years 2 months ago #179938
by Ellaisa
Replied by Ellaisa on topic Randomly assign participants to differnet question groups
Thanks!
Until now I have 40 completed questionnaires.
I was just wondering, as the first 10 were only scenario 1, afterwards 2x scenario 2 appeared and then it went on with scenario one.
I will try your solution!
Can you see any mistake in the way I did it? Or should it work out with a bigger sample size?
I need at least 100 participants
Until now I have 40 completed questionnaires.
I was just wondering, as the first 10 were only scenario 1, afterwards 2x scenario 2 appeared and then it went on with scenario one.
I will try your solution!
Can you see any mistake in the way I did it? Or should it work out with a bigger sample size?
I need at least 100 participants
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3970
5 years 2 months ago #179940
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Randomly assign participants to differnet question groups
Hi, Ellaisa
everything you did was fine.
But as always:
If you throw a coin 10 times, you won't expect it to be a 5/5 distribution.
If you throw it 100 times, you won't expect a 50/50 distributiion, but will be nearer to a 50%/50%.
I just tested:
40 times with randnumber=rand(1,2): 19 times 1, 21 times 2
40 times with randnumber=rand(1,100): 18 times 1-50, 22 times 51-100
To be able to finetune a distribution survey, I prefer the following:
1. create your random number : r1=rand(1,100)
2. The relevance of your 2 scenarios is: r1<51, resp. r1>50.
If you see that the distribution gets unbalanced, just change the relevance equation (e.g. too much "2") like
scenario 1: r1<31
scenario 2: r1>30
or even (you only need "2")
scenario 1: r1==0
scenario 2: r1>0
You can do this, even if the survey is activated.
Best regards
Joffm
everything you did was fine.
But as always:
If you throw a coin 10 times, you won't expect it to be a 5/5 distribution.
If you throw it 100 times, you won't expect a 50/50 distributiion, but will be nearer to a 50%/50%.
I just tested:
40 times with randnumber=rand(1,2): 19 times 1, 21 times 2
40 times with randnumber=rand(1,100): 18 times 1-50, 22 times 51-100
To be able to finetune a distribution survey, I prefer the following:
1. create your random number : r1=rand(1,100)
2. The relevance of your 2 scenarios is: r1<51, resp. r1>50.
If you see that the distribution gets unbalanced, just change the relevance equation (e.g. too much "2") like
scenario 1: r1<31
scenario 2: r1>30
or even (you only need "2")
scenario 1: r1==0
scenario 2: r1>0
You can do this, even if the survey is activated.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- nannancy
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
4 years 10 months ago #185207
by nannancy
Replied by nannancy on topic Randomly assign participants to differnet question groups
Hey, you can try
{SAVEDID - floor(SAVEDID / 2) * 2 + 1}
in the equation field of the hidden question.
Best
Xinyuan
{SAVEDID - floor(SAVEDID / 2) * 2 + 1}
in the equation field of the hidden question.
Best
Xinyuan
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3970
4 years 10 months ago #185210
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Randomly assign participants to differnet question groups
Of course you can use the SAVEDID.
But it is not sufficient, because the SAVEDID is incremented each time a survey is started.
So "not completed" surveys have a SAVEDID as well.
So, if by chance each second respondent does not complete the survey only odd SAVEDIDs are completed and you have all respondents in one group.
Therefore I'd prefer the random number, but checking the distribution from time to time.
Joffm
But it is not sufficient, because the SAVEDID is incremented each time a survey is started.
So "not completed" surveys have a SAVEDID as well.
So, if by chance each second respondent does not complete the survey only odd SAVEDIDs are completed and you have all respondents in one group.
Therefore I'd prefer the random number, but checking the distribution from time to time.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13624
- Thank you received: 2490
4 years 10 months ago #185216
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Randomly assign participants to differnet question groups
A good idea of puglin :woohoo:
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- AnnaSSSA
- Offline
- New Member
Less
More
- Posts: 17
- Thank you received: 0
3 years 11 months ago #199674
by AnnaSSSA
Replied by AnnaSSSA on topic Randomly assign participants to differnet question groups
Hi!
I'm working on a randomization procedure following the steps suggested into the message #179936.
When I did that 1 week ago, all was working.
Now, I have opened the survey preview and nothing is working... the hidden group question (used to randomize) is working, because it report a random number, but the group questions to show do not appear.
Which kind of error could be occurred?
What I'm sure to have done was to modify the title and description of the group question (used to randomize) and the text of the questions to show. But they are not part of the equetions used for randomizing.
Please, help me, I don't know what think about!
thanks!
I'm working on a randomization procedure following the steps suggested into the message #179936.
When I did that 1 week ago, all was working.
Now, I have opened the survey preview and nothing is working... the hidden group question (used to randomize) is working, because it report a random number, but the group questions to show do not appear.
Which kind of error could be occurred?
What I'm sure to have done was to modify the title and description of the group question (used to randomize) and the text of the questions to show. But they are not part of the equetions used for randomizing.
Please, help me, I don't know what think about!
thanks!
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3970
3 years 11 months ago #199676
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Randomly assign participants to differnet question groups
Hi,
Without even seeing your survey and your settings, what to say?
So, please, send a LSS export of your survey.
Joffm
It's like "The car doesn't start. What's wrong?"Which kind of error could be occurred?
Without even seeing your survey and your settings, what to say?
So, please, send a LSS export of your survey.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- AnnaSSSA
- Offline
- New Member
Less
More
- Posts: 17
- Thank you received: 0
3 years 11 months ago - 3 years 11 months ago #199682
by AnnaSSSA
Replied by AnnaSSSA on topic Randomly assign participants to differnet question groups
Of course...
These are in order the first three survey groups
Respondents' profile
XXX
the group for randomizing
XXX
the first questions' group to show randomly. I avoid to send the other 9.
XXX
thanks!
These are in order the first three survey groups
Respondents' profile
XXX
the group for randomizing
XXX
the first questions' group to show randomly. I avoid to send the other 9.
XXX
thanks!
Attachments:
Last edit: 3 years 11 months ago by AnnaSSSA.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3970
3 years 11 months ago #199684
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Randomly assign participants to differnet question groups
Hi,
we always ask for a lss export.
lsq and lsg exports are language sensitive.
And we have to create a survey first - hopefully with the same base language as the exports - to be able to import the group or question.
Joffm
we always ask for a lss export.
lsq and lsg exports are language sensitive.
And we have to create a survey first - hopefully with the same base language as the exports - to be able to import the group or question.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- AnnaSSSA
- Offline
- New Member
Less
More
- Posts: 17
- Thank you received: 0
3 years 11 months ago #199719
by AnnaSSSA
Replied by AnnaSSSA on topic Randomly assign participants to differnet question groups
Hi Joffm,
I think I have solved the mystery. My problem was the preview option that I had activated (full questionnaire). When I shifted to the group' view everything was visible.
I think I have solved the mystery. My problem was the preview option that I had activated (full questionnaire). When I shifted to the group' view everything was visible.
The topic has been locked.