Welcome to the LimeSurvey Community Forum

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

How to do randomization?

More
1 week 3 days ago #273734 by osrjunior
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition   Version 6.15.22+251103
Own server or LimeSurvey hosting: green-cobra-426206.hostingersite.com/lim...php?r=dashboard/view
Survey theme/template: Fruity
==================
In short, how do I perform a 50% / 50% randomization?

I have six groups: right-polarized (control and treatment), non-polarized (control and treatment), and left-polarized (control and treatment). I use a feeling thermometer based on a formula of 0-to-10 scales measuring how much the respondent sympathizes with former president Bolsonaro and president Lula.If the score given to Lula is higher than Bolsonaro’s, and the difference is greater than or equal to 8, the respondent is assigned to the left-polarized group (and here I need randomization so that 50% go to control and 50% to treatment).If the score given to Bolsonaro is higher than Lula’s, and the difference is greater than or equal to 8, the respondent is assigned to the right-polarized group (here I also need 50/50 randomization between control and treatment).If the respondent does not fit either of the two previous cases, they are assigned to the non-polarized group (again with 50/50 randomization between control and treatment). 
 

Please Log in to join the conversation.

More
1 week 2 days ago #273740 by Joffm
Replied by Joffm on topic How to do randomization?
Hi, you only have to create a random number (1 to 2).
We usually use this construct 
{if(is_empty(self),rand(1,2),self)}
to make sure that this random number is not changed.
Now, if the number is equal 1, display the control group, otherwise the treatment group.
The other part of the condition is your calculation of the difference.

But this is shown and explained many, many times here in the forum.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 week 2 days ago #273744 by paul.borsdorf
Here's a video about it: www.youtube.com/watch?v=3MLJvVgpuWY

Brauchen Sie Unterstützung bei der Erstellung und Auswertung von Umfragen mit LimeSurvey?
Mein Angebot als autorisierter LimeSurvey-Partner finden Sie auf meiner Website www.paulborsdorf.de

Please Log in to join the conversation.

More
4 days 2 hours ago #273767 by osrjunior
Replied by osrjunior on topic How to do randomization?
It's my firtst time at lime.

What I figure out is: (abs(lula_valor_nota - bolso_valor_nota) >= 8) AND (lula_valor_nota > bolso_valor_nota)

give me the condition group to left polarized group.

I have two questions of control and two of treatment in this group (and the others too, but I can just replicate once you show me one).

Here is where comes the {if(is_empty(self),rand(1,2),self)} in a equation question, for that I know.

What is this self and how do I link the to questions of control with 1 and two of treatment with 2?

Please Log in to join the conversation.

More
3 days 2 hours ago - 3 days 2 hours ago #273775 by Joffm
Replied by Joffm on topic How to do randomization?
HI,

What is this self

[url] www.limesurvey.org/manual/ExpressionScri...%22that%22_variables [/url]

You should really send the lss export of your survey.
This way we see your approach and can help better.

Because: (abs(lula_valor_nota - bolso_valor_nota) >=8 AND (lula_valor_nota > bolso_valor_nota)
is really complicated and not necessary.
Why the abs-function? If "lula_valor_nota - bolso_valor_nota) >=8" it is obvious that lula was greater then bolso.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 days 2 hours ago by Joffm.

Please Log in to join the conversation.

More
3 days 1 hour ago #273777 by osrjunior
Replied by osrjunior on topic How to do randomization?
After "termômetro" (that gives me who is and who isn't polarized), the groups ending in 1 has the 2 control questions, and the groups ending in 2 has the treatment questions. As I do not know how to randomize the questions (even by even), thats where I am now 

Please Log in to join the conversation.

More
3 days 10 minutes ago #273781 by Joffm
Replied by Joffm on topic How to do randomization?
What are the right, left and non polarized groups?
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
2 days 23 hours ago #273782 by osrjunior
Replied by osrjunior on topic How to do randomization?
Groups 11 and 12 left, 31 and 32 right, 21 and 22 non polarized. It has 2 groups each because I would do some pseudorandomization, but with real randomization would be 3 groups with 4 questions each

Please Log in to join the conversation.

More
2 days 8 hours ago - 2 days 8 hours ago #273787 by Joffm
Replied by Joffm on topic How to do randomization?
Hi,
first a few remarks.
1. You entered text in the survey description. 
This description is more or less only a subtitle of the survey title. (Therefore it is centered)
If you want to tell your respondents something, use the "welcome message"

2. You enabled the assessment mode? Where do you want to use it?
You see these "assessment rules" are totaly outdated. Relicts of versions before 1.92, when ExpressionScript was introduced. Now it's obsolete.
Except you want to calculate something by equations and there are negative codes, or two or more answer option shall have the same code.
Anyway, ExpressionScript is what we use nowadays.

3. Your survey is called "PESQUISA - ESTUDANTES DA UFSC".
Your question 5. What for, if you only ask students? Or do you want to set a quota to screenout other respondents?

4. question 13 should only be asked if question 12 is answered "Yes"

5.
a. In your scale the array(numbers) with drop-down layout is a really bad option. The respondent has to click twice to enter his answer.
b. If you set the min value (0) and the max value (10) there is no additional validation necessary.
c. (this >= 0) and (this <=10) and (floor(this) == this). You see that the respondent can only select a whole number from 0 to 10 in the drop-down. So why floor(this==this?

6. If you use an array, why do you only enter one single subquestion? And for the second subquestion you create a new question / a new array.

7. As I wrote before, this your condition like "abs(A-B)>10 and A>B" is nothing else than "A-B>10", resp. "abs(A-B)>10 and A<B" is nothing else than "B-A>10" 
First you remove the sign (abs), then you add it again.
The "abs" function is only useful in the third condition "abs(A-B)<=10"

Nevertheless.
I inserted the creation of the random number in the first group
and entered the necessary conditions in the groups 11 - 32 

File Attachment:

File Name: limesurvey...66J1.lss
File Size:283.92 KB


In my opinion some better ideas.
Use "bootstrap buttons"
 
Use an array for the scale
 
Images are from Wikipedia.
question called "termo" with two subquestions 
1: Lula
2. Bolsonaro
and answer options from 0 to 10
Then the conditions are changed to 
termo_1 - termo_2 >= 8 and randnum==1
termo_1 - termo_2 >= 8 and randnum==2
...
termo_2 - termo_1 >= 8 and randnum==1
...
abs(termo_1 - termo_2) <8 and randnum==1
...
Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 days 8 hours ago by Joffm.

Please Log in to join the conversation.

More
2 days 2 hours ago #273798 by osrjunior
Replied by osrjunior on topic How to do randomization?
1. Yes, but even there I have a problem. I can't remove the welcome message. I go there, there is no text to erase, so I put mine and still appears the default text.
2. I'm using chatgpt to try this tool, and I think it messed up the code with the assessment mode. I was going to text that.
3. I

Please Log in to join the conversation.

More
2 days 1 hour ago - 2 days 1 hour ago #273799 by osrjunior
Replied by osrjunior on topic How to do randomization?
First of all, thak you for helping me, you are doing "miracles" from my beginer perspective! I apreciate that you are explaining and not just doing for me, which helps a lot more.
1. Yes, but even there I have a problem. I can't remove the welcome message. I go there, there is no text to erase, so I put mine and still appears the default text.
2. I'm using chatgpt to try this tool, and I think it messed up the code with the assessment mode. I was going to text that.
3. I'm considering the intire university, including masters and phd degrees, so a lot of people will have jobs or incomes from somewhere.
4. You are right.
5. a. I agree.
b and c. Chatgpt told me, but by default the option array numbers comes with minimum value 0 and maximum 10 (or at least I don't remember having to set this), then you are totally right.
6. Because I don't know how to name the code value if I do this. 
7. Got it, you are right again!

I changed a few questions to bootstrap bottons. Now, for the array combining the two presidents, there is no option of an array with 11 points, it only has array 10 points, but I need the zero because I need the middle term. The images I don't see where I could put it, because there is no botton with that option there (considering the array 10 points). But I totally agree, it looks a lot better and it's more functional having one click and not two. I'm sending back the .lss with the changes I told you.
(The change of terms for the groups if change for one array I think I got it)
Last edit: 2 days 1 hour ago by osrjunior.

Please Log in to join the conversation.

More
1 day 9 hours ago - 1 day 9 hours ago #273801 by Joffm
Replied by Joffm on topic How to do randomization?
Hi,

Yes, but even there I have a problem. I can't remove the welcome message. I go there, there is no text to erase, so I put mine and still appears the default text.

Of course you can. I advised to move your text from the "description" to the "welcome text"
 

Or do you talk about this text?
 

This text appears if you set the survey to anonymous.
I assume your survey is an open survey. You only distribute the generic link and the students are asked to answer.
And an open survey is anonymous per definitionem. You do not know anything about any specific respondent.
So if you set the survey to "not anonymous" the message is gone.
 

here is no option of an array with 11 points, it only has array 10 points,

An array can have any number of answer options.
You are not to use this "stone age" array(10 point).
BTW: In my opinion all these "old" predefined question types are to be removed. 
Just use an "array".

And regarding ChatGPT.
Well, ChatGPT is always a source of amusement for us, of LOL and ROFL.
ChatGPT is basically hallucinating when it comes to LimeSurvey.

Better you study the sample surveys here:
[url] www.limesurvey.org/manual/ExpressionScript_sample_surveys/en [/url]

I had a quick glance at your lss.
Look much better with some slight options to improve.
Like this:
 

I will send my proposal this afternoon.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 day 9 hours ago by Joffm.

Please Log in to join the conversation.

More
1 day 4 hours ago #273802 by Joffm
Replied by Joffm on topic How to do randomization?
Hi,
here the promised sample survey.

File Attachment:

File Name: limesurvey...7769.lss
File Size:271.15 KB


Some remarks:
1. The images are on my server.
As I said you find them in the Wikipedia articles about the two persons. 
So download and upload to the "files" folder of this survey.

2. I did not change a lot in the last three groups. But I saw that the layout there is rather inconsistent.
Sometimes you use bold text, sometimes not.
Sometimes you use an HTML list <ul><li>...</li></ul>, sometimes not.
And where did you copy the text from? It contains a lot of CSS junk.
Like this "<p data-end="534" data-start="444">"
When you copy text from a word processing tool, either use the opruin "plain text" or paste first into a plain text editor (like "notepad") and afterwards into LimeSurvey.

3. And please, when using certain question types, have a look at the possible settings.
E.g. With bootstrap buttons you can select how many buttons there are displayed in one row.
 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
23 hours 32 minutes ago #273805 by osrjunior
Replied by osrjunior on topic How to do randomization?
I got almost all of what you did, thanks, got the array and what I was messing up with it, now I know how to write inside it and how to add more answers so to not to be stuck with the preset options.

1. About the images, I downloaded the imgs from the same site. I put them into the files folder of this survey. (this survey is a copy of your last .lss for me to try to replicate it by myself) 

But even only changing the server to mine,  green-cobra-426206.hostingersite.com/ , the images doesn't show. Here is a image of the server.
Using these codes it doesn't work:
<img src=" green-cobra-426206.hostingersite.com/userfiles/Lula.jpg " />
Luiz Inácio Lula da Silva
<img src=" green-cobra-426206.hostingersite.com/userfiles/Bolsonaro.jpg " />
Jair Bolsonaro

2. Got it, thanks again, I'm gonna remember this.

3. I don't have this option in mine, it only appears the first one, the second is not there.  

I think you solved all my doubts, all my problems. The only remaining one is the mistery of the images of the presidents, which you can help me solve it or I can simply not use images, although they improve the layout. 

Please Log in to join the conversation.

More
7 hours 13 minutes ago #273806 by holch
Replied by holch on topic How to do randomization?
On a side note: ...

I was writing here my concerns about the approach on how you define if someone is more leaning towards the right or the left of the political spectrum based on two quite controversial representatives of each side of the spectrum.

But I deleted my thoughts on the approach, because I think it can be misinterpreted in a forum. If you are interessed in it, let me know and I'll get my thoughts on why I thinkt he approach is highly flawed to you in some other way. :-)

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose