Welcome to the LimeSurvey Community Forum

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

Assigning groups and random information depending on group belonging

  • Ruileali_203995
  • Ruileali_203995's Avatar Topic Author
  • Visitor
  • Visitor
4 years 6 months ago #189286 by Ruileali_203995
Dear Limesurvey-Community,

I am really struggling with my survey and I hope you can help me (I'm happy about every comment and suggestion!!). I don't have any programming skills and couldn't find the solution by myself.
The survey will not be in English, please excuse language errors in the following.

My research design for my master thesis is about group influence on the willingness to pay for a product. In the survey, participants are assigned to one of two groups. After the participants state a price, they learn how much people from their group OR the other group payed in a previous study for the product and they can adjust their price after this information.

So, first the participants state a price they would pay for a sustainable product, then they answer questions on environmental topics (5point Likert Scale). (So far it was no problem for me in Limesurvey:))

Now, the score on the 5point Likert Scale shall be used to assign the participants to two groups (higher (> 30 points)or lower (<30 points) environmental consciousness). They shall see this information on their group belonging directly after this question group.

Depending on which group they belong to, they shall get randomly an information:

"High"-Group:
1. People from your group -who also scored higher on the scale- payed on average XXX in the previous study OR
2. People from the other group payed on average YYY in the previous study

"Low"-Group
1. People from your group -who scored lower on the scale- payed on average YYY in the previous study OR
2. People from the other group payed on average XXX in the previous study

Then they see their previously stated price and can either adjust it or keep it. The aim is to find out if they rather adjust the price when it is ingroup information compared to outgroup information.

My problem is:
- the assignment to groups (let Limesurvey count the Likert-Scale score and show them the correct group)
-the random information about ingroup or outgroup behavior from the previous study

I really hope you can help me.

Thank you!
Steffi
(Version 3.18.0+190923)
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #189290 by Joffm
Hi, Steffi,

this is quite easy.
Assuming your answer options of the scale are numerical("1", "2", "3") instead of the default ("A1", "A2, "A3")
you calculate the score by a question of type equation (let's call it "eqScore")

You enter the calculation by {sum(that.Q1.NAOK)} (Q1 = code of your Likert question)

Then the "High" group get the relevance equation "eqScore gt yourValue"
and the "Low" group "eqScore le yourValue"

And the randomization?
Question of type equation (let's call it "eqRandom")
In the question text {if(!is_empty(eqRandom),eqRandom,rand(1,2))}
Explanation: Depending on the structure of your survey the function "rand" might be fired more than once (e.g. if respondents are allowed to go back) and change the value. Therefore this function is only fired if the value of the equation is still empty; else the value is kept.

Please read the manual - the part about Expression Manager.

Here a prototype of your described structure.
In the active survey the equation question have to be hidden.

File Attachment:

File Name: limesurvey...4759.lss
File Size:25 KB


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Ruileali_203995
  • Ruileali_203995's Avatar Topic Author
  • Visitor
  • Visitor
4 years 6 months ago #189292 by Ruileali_203995
Dear Joffm,

thank you so much for your quick and detailed answer! You are great help.
The topic has been locked.
More
4 years 3 months ago #192699 by Chevalier3
Dear Joffm,

I am new to Limesurvey and I am having trouble understanding how randomization works. I also don't know how to code or anything...
When I see this for example: {if(!is_empty(eqRandom),eqRandom,rand(1,2))}, I have no idea where to write it...
Could you help me?

I have 5 groups of questions in my survey.
-general questions
-test 1
-test 2 - group 1
-test 2 - group 2
-test 2 - group 3

I would like all my participants to do -general questions and - test 1 and then be randomly assigned to either -test 2 - group 1 or -test 2 - group 2 or -test 2 - group 3.

How can I do that?

Thank you in advance!

Jessica
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 months ago #192700 by Joffm
Hi, Jessica,
first the basics.
If you read in the manual about implemented functions
manual.limesurvey.org/Expression_Manager...mplemented_functions
you see that the function rand(x,y) creates a random number between x and y.
And you know that in Expression Manager there are curly brackets around a formula.

And the randomization?
Question of type equation (let's call it "eqRandom")
In the question text {if(!is_empty(eqRandom),eqRandom,rand(1,2))}
Explanation: Depending on the structure of your survey the function "rand" might be fired more than once (e.g. if respondents are allowed to go back) and change the value. Therefore this function is only fired if the value of the equation is still empty; else the value is kept.


This is the same as in EXCEL.
To avoid this, we use this construct:
{if(!is_empty(eqRandom),eqRandom,rand(1,2))}
Here the question code of our random number equation is "eqRandom".
And the meaning is:
if(!is_empty(eqRandom),: IF the random number is not empty,
eqRandom: keep the already calculated random number
rand(1,2): ELSE use the function "rand" to calculate one.

The if-statement also is explained in the above link "implemented functions".


Now your scenario:
First you create your question of type equation (let's have it the question code "rnumber")
Here you enter the above explained
{if(!is_empty(rnumber),rnumber,rand(1,3))}

And in the relevance equation of your three GROUPS you enter in
test2 - Group1: rnumber==1
test2 - Group2: rnumber==2
test2 - Group3: rnumber==3

That's all.

Here an example.
It is nearly the same that I attached to Steffi's question, but adapted to your scenario.


Joffm

File Attachment:

File Name: limesurvey...1-14.lss
File Size:21 KB

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: tpartner, cdorin
The topic has been locked.
More
4 years 3 months ago #192805 by Chevalier3
Hi Joffm,

Thank you so much for your help, I managed to make it work!

Jessica
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose