Welcome to the LimeSurvey Community Forum

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

Struggling with randomisation

  • JackMackSir
  • JackMackSir's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 5 months ago #208481 by JackMackSir
Struggling with randomisation was created by JackMackSir
Hi everyone,

I have two different versions of the first question in my survey, and I would like to randomly assign each participant to see one of the versions. My sample size is likely to be small so i'll have to use some form of block randomisation so that the numbers in each group are close to equal. How exactly do I do this?

Thanks,
Jack
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #208495 by holch
Replied by holch on topic Struggling with randomisation
It depends a little bit on how you invite your respondents.

If you know them / have a list you could create a custom attribute in the token table to already assign them with one or the other question (can be done randomly when creating the token table). But, if not everyone participates there is still a chance that you won't have 50% for each question. But in general those that won't answer should be more or less evenly distributed.

Now if you don't know them, then you will have to create a random number and show the questions accordingly. Of course, to get an even distribution you would need a big sample.

However, if you create random numbers from 1-10 and then show question 1 if the numbers 1-5 were drawn and question 2 if the numbers 6-10 were drawn you have more room to adapt your relevance equations.

For example, if you see that one question is getting more responses, you can go for 1-4 and 5-10 for example to skew towards question version 2, etc. But it will always need a certain manual involvement.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: JackMackSir
The topic has been locked.
  • JackMackSir
  • JackMackSir's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 5 months ago #208641 by JackMackSir
Replied by JackMackSir on topic Struggling with randomisation
Thank you for your reply. What exact code would I put into LimeSurvey to achieve this? I'm very new at this kind of thing.

Thanks,
Jack
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #208642 by holch
Replied by holch on topic Struggling with randomisation
There are quite a lot of descriptions on how to create a random number here in the forum.
The basic concept:
1. Create a Equation type question (which you will hide at the end, but keep it shown during the test phase)
2. Within this equation type question, let's call her "rand" you will include a expression that generates the random number, with a code like this:
Code:
{if(is_empty(rand.NAOK),rand(1,2),rand.NAOK)}
What happens here? First LS checks if the random number has already been set. If this is the case, it leaves it like it is. If it is not set, then it creates a random number between 1 and 2 in this example. Why is this necessary? If you don't check if the randomnumber is checked already, there will be a new random number draw whenever you call the "rand" question. But generally you want to just draw the random number once and then it should be fixed.

If you want to have a little bit more flexibility to influence which solution is showing, then you could create a random number from 1-10 with "rand(1,10)" and then in the relevance equations for each of the two questions you can write something like "rand<6" and "rand>5" to show and hide each question.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: JackMackSir
The topic has been locked.
  • JackMackSir
  • JackMackSir's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 5 months ago - 3 years 5 months ago #208644 by JackMackSir
Replied by JackMackSir on topic Struggling with randomisation
That worked. Thanks very much for your help.
Last edit: 3 years 5 months ago by JackMackSir.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose