Welcome to the LimeSurvey Community Forum

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

Randomizing treatment + control groups based on a question

  • nabt987
  • nabt987's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 5 months ago #223785 by nabt987
I am currently designing a survey that is nearly complete, but I am running into some issues. Essentially, based on someone's dietary preferences, we want them to fall one of two different groups. If  someone is a vegetarian/vegan/pescatarian, we want these three dietary preferences to fall under one group: Vegetarians/Vegans. People who eat meat, on the other hand, will fall under the Meat-Eaters group. The Vegetarians/Vegans group consists of 6 question groups: 2 treatment group one, 2 control groups, 2 treatment group two. The same applies for the Meat-Eaters, ultimately adding up to 12 question groups. 

I have managed to successfully create an equation question called "randnumber" which has the equation {rand(1,12)} in it. This allows all participants to randomly be put into either a Treatment One, Treatment Two, or Control group out of the 12 in the survey. Now, my confusion is that I want the participants to additionally be put into one of these question groups based on their dietary preferences. There is a multiple choice question in the survey that allows us to determine their dietary preferences. If they select "vegan", "vegetarian", or "pescatarian", they should essentially be put into 1 of the 6 Treatment One, Treatment Two, or Control Groups within the Vegetarian/Vegan category. I don't know how to do this. I have tried to put the conditions into the relevance equation, so that if someone selects those options in the multiple choice only then will they see those specific groups. This works most of the time, but not always as it should. 

Any ideas on what to do? Let me know if I should attach the lss file.
Thank you! 
 
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #223798 by Joffm
Hi,
1. Why did you not answer the questions at the beginning?
2. A lss export of the relevant questions (e.g.  a prototype that shows the structure) is always better than a long explanation.

Well, you have a question Q1 (single?) that asks the dietary preferences. like
1: meat
2: fish
3: vegetarian
4: vegan


So you get the conditions for
"vegans": Q1==4
"vegetarians": Q1==3
"fish": Q1==2
"no grass eater"; Q1==1 OR Q1==2  (or the same: Q1 lt 3) 

And your "vegan/vegetarian/pesc" group:Q1>1 AND Q1<5
Now you add your random number to select the control resp. treatment groups
like
(Q1>1 AND Q1<5) AND randnumber==1
(Q1>1 AND Q1<5) AND randnumber==2
​​​​​​​(Q1>1 AND Q1<5) AND randnumber==3
​​​​​​​ 
You see that you only can use the "greater than" and "less than" operators if you use numerical codes, not the offered "A1", "A2".
With these alphanumerical codes you have to say Q1=="A2" OR Q1=="A3" OR Q1=="A4" 

​​​​​​​Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #223817 by holch
Why do you create a random number between 1-12? In my opinion this only makes sense if you would randomly assign people to be "Vegetarian/Vegan" or "Meat eaters". But from what I understand, this is not the case. You want to have vegetarians in the vegetarian group and meat eaters in the meat eater group.

So you basically want to separate them based on what they are first, and then within this groups you want to distribute them into 6 different groups, correct?

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose