Welcome to the LimeSurvey Community Forum

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

Experimental randomisation

  • VickyLyonEPP
  • VickyLyonEPP's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #186212 by VickyLyonEPP
Experimental randomisation was created by VickyLyonEPP
Hi!
I'm trying to create a survey that will randomly attribute each participant to one of four groups. Each group should then view a different stimuli (text). The rest of the survey should be the same for everyone.

As far as I can tell, the randomization function allows us to present the questions in a random order, but not to create separate groups? Is there any way to do this? I'm very unfamiliar with limesurvey, so any help would be much appreciated.

Thank you!!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #186220 by tpartner
Replied by tpartner on topic Experimental randomisation
You will need to load a hidden (via CSS) equation question with a random number 1-4 and then place relevance/conditions on your "stimuli" questions based on the hidden random number.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • VickyLyonEPP
  • VickyLyonEPP's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #186222 by VickyLyonEPP
Replied by VickyLyonEPP on topic Experimental randomisation
Thank you for your reply! Is there any place I can learn how to do this? A walk through, tutorial, video...? I've been trying to read the manual but it's very confusing!
The topic has been locked.
  • VickyLyonEPP
  • VickyLyonEPP's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #186237 by VickyLyonEPP
Replied by VickyLyonEPP on topic Experimental randomisation
I found another question about this and followed the instructions:
create a question of type "equation" (question code? let's say "randomnumber")

question text: {if(!is_empty(randomnumber),rand(1,2,3,4),randomnumber)}

Question 1, relevance equation: "randomnumber==1"
Question 2, relevance equation: "randomnumber==2"
Question 3, relevance equation: "randomnumber==3"
Question 4, relevance equation: "randomnumber==4"

However the randomized question doesn't show up when I preview the survey. Does anyone have any idea of what I'm doing wrong?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #186239 by tpartner
Replied by tpartner on topic Experimental randomisation
The equation question text should be:

Code:
{if(!is_empty(randomnumber), rand(1,4), randomnumber)}

- manual.limesurvey.org/Expression_Manager#Access_to_Functions

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • VickyLyonEPP
  • VickyLyonEPP's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago - 4 years 9 months ago #186240 by VickyLyonEPP
Replied by VickyLyonEPP on topic Experimental randomisation
Thank you! makes sense! however I still dont see the randomized questions showing up. Is there something I'm missing? Something to activate in the settings maybe?

Edit: I unhid the equation question but don't see any number show up when I preview. Is that normal?
Last edit: 4 years 9 months ago by VickyLyonEPP.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #186241 by tpartner
Replied by tpartner on topic Experimental randomisation
No, can you attach a small sample survey (.lss file) containing only the relevant questions?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • VickyLyonEPP
  • VickyLyonEPP's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago - 4 years 9 months ago #186243 by VickyLyonEPP
Replied by VickyLyonEPP on topic Experimental randomisation
Here is the .lss, I removed all the other questions

File Attachment:

File Name: limesurvey...9241.lss
File Size:20 KB
Last edit: 4 years 9 months ago by VickyLyonEPP.
The topic has been locked.
  • VickyLyonEPP
  • VickyLyonEPP's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #186245 by VickyLyonEPP
Replied by VickyLyonEPP on topic Experimental randomisation
I replaced
{if(!is_empty(randomnumber), rand(1,4), randomnumber)}
by
{rand(1,4)}
It works!
However, I haven't hidden that question yet, and while testing, I noticed that when I saw the number that showed up didn't always match the question it was assigned to (eg I saw the number 3 but the question that showed up was assigned randomnumber==1 )
I hope this is normal?
Thank you very much for you time in any case!
The topic has been locked.
  • VickyLyonEPP
  • VickyLyonEPP's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #186246 by VickyLyonEPP
Replied by VickyLyonEPP on topic Experimental randomisation
I do just have a final question though, I've tried it again and though the questions do show up randomly, the number that showed up didn't always match the question it was assigned to (eg I saw the number 3 but the question that showed up was assigned randomnumber==1 ).
In that case, how can I know which question the participants saw when I do the data analysis?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #186255 by tpartner
Replied by tpartner on topic Experimental randomisation
It's because Expression Manager sets the equation question both on page load and submit - that's why you put the IF statement in so the equation question is only loaded if it's empty.

Having said that, you had some unnecessary HTML and a typo in the equation question.

It should be:

Code:
{if(is_empty(randomnumber), rand(1,4), randomnumber)}

Working sample survey attached:

File Attachment:

File Name: limesurvey...9924.lss
File Size:20 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #186262 by DenisChenu
Replied by DenisChenu on topic Experimental randomisation

tpartner wrote: Having said that, you had some unnecessary HTML and a typo in the equation question.

:)

It's the reason of manual.limesurvey.org/Question_type_-_Eq...ation_.28equation.29

clean textarea without HTML editor : less chance to add broken html :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose