Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Randomize groups using conditions

  • ggrilli
  • ggrilli's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 9 months ago #219596 by ggrilli
Randomize groups using conditions was created by ggrilli
Hello, I have a tricky problem to solve. I have a questionnaire on food habits and 3 groups of respondents to randomly allocate to the following groups: vegetarians, beef eaters and chicken eaters. I included a screening question that asks respondents if they eat vegetables, beef or chicken that I need to exclude 1 or 2 groups. For example: 

- if the respondent eats vegetables and chicken only: assign one between vegetable group or chicken group randomly
- if the respondent eats vegetables and beef only: assign one between vegetable group or beef group randomly
- if the respondent eats beef and chicken only: assign one between beef group or chicken group randomly
- if the respondent eats vegetables only: assign vegetable group (no randomization)

Ideally I want these 3 groups to be balanced. Any idea?

Thanks in advance
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago #219599 by Joffm
Replied by Joffm on topic Randomize groups using conditions
Hi,
please send a lss export of your survey, respective these relevant questions/groups.
This can be done by a few equations and relevance equations.

But I have not time to create a sample survey.

Ideally I want these 3 groups to be balanced

How do you imagine this?
In the worst case there are no respondents who eat beef. So, what can you do?
Of course you can change the probability to be thrown into vegetable vs. chicken from 50:50 to 80:20, if the chicken group is nearly filled.
But this is something we see later with your survey.

Joffm

By the way: I assume, if he eats all three, he will be assigned randomly to two of the groups.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • ggrilli
  • ggrilli's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 9 months ago #219603 by ggrilli
Replied by ggrilli on topic Randomize groups using conditions
 

File Attachment:

File Name: limesurvey... (1).lss
File Size:24 KB


Here's an overly simplified IIS file of the survey. There are 4 groups all with one question: the screening, beef, chicken, and vegetable

With respect to your question, I can't be sure to balance the three groups equally. We will draw our sample from a nation-wide representative panel, so I would anticipate that we have enough respondents to cover all food preferences. My initial idea was to set a maximum N for each group and when the maximum is achieved the group is not shown anymore, only the other 2 remains. Or do it manually by removing one group on the fly. This is another issue to look at when the the random assignment is fixed...

Thanks a lot
Gianluca
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago - 3 years 9 months ago #219615 by Joffm
Replied by Joffm on topic Randomize groups using conditions
Hi, Gianluca,
here your survey back.
You seem to work with an old version of LimeSurvey (2.50 - 2.73).
So I used 2.73.1.

 

File Attachment:

File Name: limesurvey...3334.lss
File Size:27 KB

 My initial idea was to set a maximum N for each group and when the maximum is achieved the group is not shown anymore

To do this you need to have access of all other responses.what is not possible in older versions of LimeSurvey.
There is a plugin "getStatInSurvey" for 3.x., in 5.x. such a function is built-in.

So, you may adapt the first "join" function (remove the not necessary part.)

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 9 months ago by Joffm.
The topic has been locked.
  • ggrilli
  • ggrilli's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 9 months ago #219709 by ggrilli
Replied by ggrilli on topic Randomize groups using conditions
Thanks a lot Joffm,

That was really helpful. Actually I am working with Limesurvey browser, not desktop, so I am not sure what version i have. I'll check out whether I can access the newest version! Thanks

Ggrilli
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago #219711 by tpartner
Replied by tpartner on topic Randomize groups using conditions
There is no "desktop" version of LimeSurvey, it is all web-based.

You should see the version details at the bottom right of admin screens.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose