Welcome to the LimeSurvey Community Forum

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

Randomizing Only Certain Paritipants into Different Groups

More
1 day 6 hours ago #273502 by c.otieno
Please help us help you and fill where relevant:
LimeSurvey version: [6.15.19]
Own server or LimeSurvey Cloud: Cloud
Survey theme/template: Inherit [fruity_twentythree]
==================
Hello Limesurvey community,

I'm a first-time Limesurvey user. 

I'd like only certain participants from a previous question (yes/no type) to be randomized in these 3 groups. That is, if they answer no to the previous question, they are randomized into one of the next 3 questions, otherwise if yes, they proceed to other questions. How do I go about it? I have already created a hidden equation question coded RANDGROUP with the equation rand(1,3), but I haven't figured out how to ensure only the no responders are randomized. I tried adding a condition in the next 3 questions that are to be randomized ( e.g., if previous question == N), but seemingly something gets overwritten in the process. I see either all or none of the three questions when I preview the survey.

Additionally, two of the 3 questions participants are to be randomized are also yes/no type, while the other in an array type. For the 2 yes/no questions, I cannot find the relevance equation tab where I can input the command to show the specific question to desired assigned group. For the array question, do I have to key in the relevance equation for every subquestion?

(Side question: How evenly are participants randomized? I'd like a 1:1:1 ratio)

Looking forward to your tricks and tweaks.

Thanks in advance.

Please Log in to join the conversation.

More
1 day 1 hour ago #273509 by Joffm
Hi,
sorry, I did not understand exactly what you want to achieve.
But the first part is easy.
If your Yes/No question is Q1 and the equation RANDGROUP, then your three random questions get the condition
1st: Q1=="N" AND RANDGROUP==1
2nd: Q1=="N" AND RANDGROUP==2
3rd: Q1=="N" AND RANDGROUP==3

And as I wrote, this is entered in "condition" (general settings) on question level.

If there are further quesrions, please send the lss export of the survey, resp. the relevant parts.
Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 day 44 minutes ago #273511 by c.otieno
Hi Joffm,
Thanks for your reply. I have attached the relevant files.

Here is what I want to achieve:
 - My Q1 is coded EVERTEST and it asks respondents: Have you ever tested for a genetic condition X? (Yes/No)
 - If the respondent answers 'No', they need to be randomized into one of the three questions coded (GROUP1, GROUP2, or GROUP3)
 - For the randomization, I've created a hidden equation question RANDGROUP.

The problem:
Even after effecting the conditions, when I preview the survey and answer 'No' to EVERTEST, I am not randomized into any of the three groups. Instead, I'm proceeded to the next section of the survey as someone who would have answered yes. I hope the issue is clearer now.

Please Log in to join the conversation.

More
23 hours 6 minutes ago #273513 by holch
Please do not provide LSQ or LSG files, only LSS files. Why?

Because we need to create a survey and survey groups to import your LSQ, which adds to the work load. Also, we need to guess the base language to be able to import the LSQs into the survey.

So, please provide a LSS file. And no, we do not want your whole survey, only the relevant parts are enough. How to do this?

copy the survey, delete everything that is not necessary, export this cleaned survey as LSS and upload it here.

Also, make sure that you create the random number correctly, rand(1,3) is usually not enough. There are many examples in the forum on how to create good (and stable) random number in Limesurvey.

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.

Please Log in to join the conversation.

More
21 hours 48 minutes ago #273515 by c.otieno
Hi Holch,
Sorry for any inconveniences. I am fairly green to Limesurvey.

I have now uploaded an LSS file of the relevant parts of my survey as instructed.

I've also amended the equation question rand(1,3) to {if(is_empty(RANDGROUP), rand(1,3) RANDGROUP)}.

I hope you can now trace my issue. 

Looking forward to your response.

Please Log in to join the conversation.

More
21 hours 7 minutes ago #273516 by holch
First of all: When testing, always show the hidden questions, it might give you some hints if things go wrong somewhere. If the random number for example is hidden, you won't know if the correct question is shown, based on that random number.

I have also included RAND1, RAND2, RAND3 at the beginning of the question, because the text looks very similar for each of the groups, so it is difficult to see if the right text is shown or not.

Those are some general tips to make testing and trouble shooting easier.

However, but all this is not your issue.

For group 1 and 2 you defined the condition, for group 3 you defined subquestion relevance and no condition on the question, which seems to be odd to me.

So I fixed that.

I also moved the scenarios into a separate group and they now show, depending on the random number, when "no" is chosen in the first question.

So the issue is that you need to have them in separate groups (show them on different pages) than the first 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.

Please Log in to join the conversation.

More
20 hours 35 minutes ago #273517 by Joffm
Hi,
and the reason for this (not possible to display in one group) was this typo.
{if(is_empty(RANDGROUP), rand(1,3)RANDGROUP)}

Remember: The IF function has three parameters
1. the condition "is_empty(RANDGROUP)"
2. what happens, if the condition is TRUE "create a random value: rand(1,3)"
3. What happens, if the condition is FALSE "keep the existing value: RANDGROUP"

Therefore
{if(is_empty(RANDGROUP), rand(1,3), RANDGROUP)}




Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: holch

Please Log in to join the conversation.

More
8 hours 36 minutes ago #273520 by c.otieno
Hi Joffm and Holdch,

I have fixed the typo in my equation and it's now worked :)

@holch I have now defined the condition for all three groups. Thanks :). But I've not had to to have the questions in a separate group after fixing the typo. 

I'm currently looking up how I can have half of the participants in GROUP3 see the percentages displayed in an ascending order (while the other half as already is), to avoid bias in responses. Basically randomizing GROUP3 answers into 2 orders, ascending and descending.

I'd appreciate any tips:)

Please Log in to join the conversation.

More
7 hours 33 minutes ago #273522 by Joffm
Double the question
Q3a: display in ascending order
Q3b: display in descending order

Randomisation:
Either create your RANDGROUP from 1 to 6 and show
Q1: RANDGROUP <3 ( 1 or 2)
Q2: RANDGROUP== 3 or RANDGROUP==4
Q3a: RANDGROUP ==5
Q3b: RANDGROUP ==6

OR
create a second random number "R2" (1 to 2) and show
Q1 and Q2, as you did already
Q3a: RANDGROUP==3 AND R2==1
Q3b: RANDGROUP==3 AND R2==2

Joffm


 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
7 hours 20 minutes ago #273524 by holch
@Joffm: Yeah, I fixed that too, but forgot to mention it yesterday. Thanks for pointing that out. This would have been a show stopper as well.

@c.otieno: OK, strange. For me it only worked when I put the "group" questions into a second question group. Do you display the survey question by question?

I don't think there is a way to order the subquestions via expression script, so you will probably have to go down the route Joffm described. Create 2 versions of the Group3 question and order the answers/subquestions accordingly.

This will require a different distribution and thus a different approach to the randomized number. Joffm has explained two approaches already.

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.

Please Log in to join the conversation.

More
7 hours 19 minutes ago #273525 by holch
One tip that has nothing to do with this: i would format the text in the questions a bit better, I find them currently very hard to read and follow.

A little structure would certainly help with that.

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.

Please Log in to join the conversation.

More
6 hours 21 minutes ago #273526 by Joffm
And if you are allowed to use javascript you can insert this script into the question (source code mode)
Code:
<script type="text/javascript" data-author="Tony Partner">
  $(document).on('ready pjax:scriptcomplete',function(){
    var thisQuestion = $('#question{QID}');
    var thisAnswerList = $('tr.answers-list:eq(0)', thisQuestion).parent();
    var r=Math.floor(Math.random() * 2);
    var sqCodes = [1,2,3,4,5,6];
    if (r==1) { sqCodes = [6,5,4,3,2,1]; }
 
 
    // Loop through the answer codes
    $.each(sqCodes, function(i, val) {
      // Move the answer item
      $(thisAnswerList).append($('tr.answers-list[id$="X{QID}'+val+'"]', thisQuestion));
    });
 
  });
</script>





Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
5 hours 49 minutes ago #273527 by c.otieno
Thanks Joffm.

I've gone by the second option and it's working great. 

@holch I display the survey group by group (what's the best practice?). Thanks for the side tip on format as well. Not sure what exact exactly is wrong because I also found the font in Joffm's screenshots too tiny, but from my preview end, it's legible enough (using Georgia default size). 

Please Log in to join the conversation.

More
4 hours 44 minutes ago #273528 by Joffm
Hi,

I display the survey group by group (what's the best practice?)

in online surveys one rule is "one question per page".
Except two short questions, or a follow-up question like "Please, explain why you rated so low"

To be most flexible, we recommend to display "group by group", but with only one question per group.
This way the participant has the look&feel of "question per question", but you are able to merge some questions by javascript, display two questions on one page, etc.
This is in my opinion the best way in 90% of all survey designs.
If there are special requirements (mostly concerning randomisations) there may be necessary other solutions.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
4 hours 9 minutes ago #273530 by c.otieno
Hi Joffm,
Thanks for this detailed explanation. I have changed my display settings to question by question and immediately noticed the difference. There's a better reflection on each question and less response fatigue. 

In case I encounter any issues with my randomizations using this display format, I will come back to this thread to seek solutions :)
 

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose