Welcome to the LimeSurvey Community Forum

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

Can I add a crosswise quota?

  • LSWipo
  • LSWipo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 11 months ago #228091 by LSWipo
Can I add a crosswise quota? was created by LSWipo
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.0 Theme Editor
Own server or LimeSurvey hosting:
Survey theme/template: test_theme 
==================
Hello, 

I would like to add quotas to the survey but I would like to do it crosswise. There are gender and age categories in the survey both are list (dropdown). For age, I have the following categories: 0-19, 20-29, 30-39, 40-49, 50-60, 60+ 

The conditions that need to be met: 

No respondents in age group 0-19 and 60+ (I set a quota to 0 for these groups)
I need to have 600 females from the age group 20-39, so I need to bin three categories: 20-29, 30-39, and female 
I also need to have 700 males from the age group 20-39 
400 (300) females from the age group 40-49 (50-60)
500 (400) males from the age group 40-49 (50-60)

I read the manual but I could not find a way. I will appreciate it if you could help. 



 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago - 1 year 11 months ago #228092 by Joffm
Replied by Joffm on topic Can I add a crosswise quota?
Create a question of type equation where you generate these 6 groups with a nested IF.
{if(age==2 or age==3,(sex-1)*3+1,if(age=4,(sex-1)*3+2,if(age==5,(sex-1)*3+3,'')))}

Always assuming you used numerical codes 1,2,3,...

Set the quota on this equation.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 11 months ago by Joffm.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #228103 by Joffm
Replied by Joffm on topic Can I add a crosswise quota?
An addition to explain this equation.

Let's say you coded like this
sex:
1: male
2: female

age:
1: 0-19
2: 20-29
3: 30-39
4: 40-49
5: 50-59
6: 60+  

Except the quotas with limit 0 for the too young and too old people, you have 6 groups
1: male and age between 20 and 39
2: male and age between 40 and 49
3: male and age between 50 and 59
4: female and age between 20 and 39
5: female and age between 40 and 49
6: female and age between 50 and 59

Now a little bit of school artithmetic.
The same age group is either in quota group "1" or "4", "2" or "5", -> X or X+3 depending on sex.

(sex-1) is either "0" or "1"
(sex-1)*3 is either "0" or "3"

if there wasn't this "double" age group you could have proceed with something like (sex-1)*3 + age-1
Now you have to use a nested IF:
{if(age==2 or age==3,(sex-1)*3+1,if(age==4,(sex-1)*3+2,if(age==5,(sex-1)*3+3,'')))}

For age=2 or age=3 the result is either "1" or "4" 
For age=4 the result is either "2" or "5" 
For age=5 the result is either "3" or "6" 

To avoid this nested IF you could use assessment mode like this.
Here you use the advantage to have the same assessment value for different answer options.


Now this is sufficient
{(sex-1)*3 + age.valueNAOK}

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: LSWipo

Please Log in to join the conversation.

  • LSWipo
  • LSWipo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 11 months ago #228679 by LSWipo
Replied by LSWipo on topic Can I add a crosswise quota?
Thank you so much for your answer. Without the additional explanation, I would not be able to understand the logic of the equation.

I checked the answer of the "quotas" equation question and it is precisely equal to the answers you suggested. So, I guess I add the equation correctly.

I set the quotas, with one difference, female= 1 and male= 2. Do the quotas look correct?

   

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #228687 by Joffm
Replied by Joffm on topic Can I add a crosswise quota?
Did you check with a "0" quota?

Should be fine.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: LSWipo

Please Log in to join the conversation.

  • LSWipo
  • LSWipo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 11 months ago #228693 by LSWipo
Replied by LSWipo on topic Can I add a crosswise quota?
I just double checked it, and it is working.

Thank you so much again!

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose