Experimental randomisation

More
5 months 3 days ago #186212 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!!

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
5 months 3 days 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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
5 months 3 days ago #186222 by VickyLyonEPP
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!

Please Log in or Create an account to join the conversation.

More
5 months 3 days ago #186237 by VickyLyonEPP
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?

Please Log in or Create an account to join the conversation.

More
5 months 3 days ago #186239 by tpartner
Replied by tpartner on topic Experimental randomisation
The equation question text should be:

{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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
5 months 3 days ago - 5 months 3 days ago #186240 by VickyLyonEPP
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: 5 months 3 days ago by VickyLyonEPP.

Please Log in or Create an account to join the conversation.

More
5 months 3 days 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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
5 months 3 days ago - 5 months 3 days ago #186243 by VickyLyonEPP
Here is the .lss, I removed all the other questions

File Attachment:

File Name: limesurvey...9241.lss
File Size:20 KB
Attachments:
Last edit: 5 months 3 days ago by VickyLyonEPP.

Please Log in or Create an account to join the conversation.

More
5 months 3 days ago #186245 by VickyLyonEPP
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!

Please Log in or Create an account to join the conversation.

More
5 months 3 days ago #186246 by VickyLyonEPP
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?

Please Log in or Create an account to join the conversation.

More
5 months 2 days 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:

{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.
Official LimeSurvey Partner - partnersurveys.com
Attachments:

Please Log in or Create an account to join the conversation.

More
5 months 2 days ago #186262 by DenisChenu

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 .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #186358 by VickyLyonEPP
Thank you so much! I had copied the equation somewhere and didn't realize. It works now! :)

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #186521 by VickyLyonEPP
I've realized that I've enough participants in group 2, but not enough in groups 1, 3, and 4. Is there any way to rewrite
rand(1,4)
to exclude the number 2 and only randomly assign 1, 3, and 4?

Thank you! !

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #186522 by tpartner
Replied by tpartner on topic Experimental randomisation
Set the equation to rand(1, 3) and then change the group relevance.

Group 1: randomnumber == '1'
Group 2: randomnumber == '99'
Group 3: randomnumber == '2'
Group 4: randomnumber == '3'

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!