Welcome to the LimeSurvey Community Forum

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

Randomly assign participants to differnet question groups

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #199756 by Joffm
Hi, Anna,

therefore it is important to send lss exports.
Here the survey settings are included.

If we only import a question or a group our settings are taken, and we may talk for years without finding the issue.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 4 months ago #207380 by JohannRoeben
Hi Tony,
I am trying to do the same, however, it says "undefined variable" for 'randnumber'. Where EXACTLY do I put this code: "if(is_empty(randnumber.NAOK), rand(1, 100), randnumber.NAOK)" ?
I am sure this is a dumb question but I have no experience at all in this kind of stuff..
You would help me a lot with an answer.
Thanks.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #207385 by Joffm

"if(is_empty(randnumber.NAOK), rand(1, 100), randnumber.NAOK)" ?

This you put into the question text of a question of type "equation" with question code "randnumber"?

But WITH curly brackets around
{if(is_empty(randnumber.NAOK), rand(1, 100), randnumber.NAOK)}

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 4 months ago #207389 by JohannRoeben
Thanks a lot. That worked!!
The topic has been locked.
More
3 years 3 months ago - 3 years 3 months ago #208774 by AnnaSSSA
Hello everyone,
Can I apply the same method you suggested to Ellaisa when the groups of questions to randomize are more than 2 (they exactly are 15)? I image I can define specific ranges of values for each group (eg. r1<101; r1>100 and r1<201; r1>200 and r1<301; etc.)Is it right? Have I correctly written?
Thanks!
Anna
Last edit: 3 years 3 months ago by AnnaSSSA.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #208780 by Joffm
Hm,
to clarify:
WHAT do you want to do?
1. Display your 15 groups in random order?
Buzzword: randomization group name; each of the 15 groups gets the same "randomozation group name".

2. Display randomly one out of the 15 groups?
Create a random number and assign in "relevance equation" to the groups.
And it's up to you, how you do this.
Either a random number (1-15) and
group1 : randnum==1
group2 : randnum==2
group3 : randnum==3
...

or a random number (1-1500) and
group1 : randnum le 100
group2 : randnum gt 100 and randnum le 200
group3 : randnum gt 200 and randnum le 300
...

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 3 months ago - 3 years 3 months ago #208784 by AnnaSSSA
Thanks!
I would like to show 1 out of 15 questions' groups and be sure to collect answers from at least 100 respondents for each group.
So I think that your third solution fits well with my goal. And when I achieve it, I can apply the 'classic' approach (your second solution).
Is it right?
Last edit: 3 years 3 months ago by AnnaSSSA.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #208791 by Joffm
I hope you understood, why there is the solution with the range instead of just 1-15.

If you create a random number from 1-15, you can only deselect groups with enough participants.
Lets say, there are already 105 participants in group 8, but only 87 in group 3.
So you will change the relevance equation of group 8 to "randnum==0" (what is iimpossible) and the relevance equation of group 3 to "randnum==3 OR randnum==8" that you get more participants to group 3.

And with the ranges you have the option to fine tune.
If you see that the distribution is a bit unequal, you can change to
group 1: randnum lt 90
group 2: randnum ge 90 and randnum lt 210
group 3: randnum ge 210 and randnum lt 305
...
This way you can adapt the probability of the groups during fieldwork.

Joffm

But if you expect at least 100 participants per group a random number 1-15 will work fine.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 3 months ago #208795 by AnnaSSSA
Thanks, now it is clearer.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose