Is it possible to randomly assign participants to two different question groups?
Basically, half of the subject pool must take a path and the other half another (randomly). At the end of the survey I will have a treated group and a control one.
However, I also attached an LSS file which is a survey file that you can import as a new survey and have a look how it is done. Because of course the code posted above needs to be adapted to your questions codes. It is a working example of the code that I posted. So it makes sense to import it, have a look at it how it is done (one equation question with the code above that generates a random number (in this case either 1 or 2). Then you use relevance equations to hide and show certain questions accordingly. At the end of testing, when everything works well you will hide the equation question.
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.
So, if my understanding is correct I have to do the following (probably is not :S ).
I have to add an hidden question that is an equation type question. And then to conditionally attach one of the two paths at the equation.
Now suppose I have already created the two groups of questions.
The only common part is the welcome page at the beginning, then the questionnaire can randomly take one of the two paths (this is what I am trying to do).
The first group is called Treated Group and coded TG1, TG2, TG3, et cetera... .
The second group is called Control Group and coded CG1, CG2, CG3, et cetera... .
Some parts in both groups are common but I already copied them, so that they are independent.
To summarize, I have to add the code you suggested in the following way?
What does this code do? It checks if the equation question Q1 has been triggered already and already has a random number set (isempty(Q1)). If it is empty, then it will create a random number of 1 or 2. However, if the random number is already set in the question Q1, then it will do nothing, but just use its own value. Why so complicated? why not only use {floor(rand(1,2))} to create a random number? Because then whenever the equation is triggered a new random number is created, which of course we wouldn't want. We want it to be set once the first random drawing was done.
Then in the following question, in your case the groups actually, you insert in the relevance equation of the respective groups something like {Q1==1} to show/hide the group when Q1==1, e.g. for the treated group, and {Q1==2} to show/hide the control group.
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.