Documentation

GB 16-54

You can insert this screener into your survey using

Code
s.standard_screener("GB", "16to54")

You can also pass the optional id parameter to set a stable identifier prefix for the generated screener questions; if it is not set, the question text is used.

Or if you want to edit it, just copy and paste the code below:

Code
age = s.numeric_question( question="How old are you?", min_max=(16, 54), recodes={ "16-24": "16-24", "25-34": "25-34", "35-44": "35-44", "45-54": "45-54", }, ) gender = s.select_question("What is your gender?", ["Male", "Female", "Non-Binary", "Prefer not to say"]) income = s.numeric_question( "What is your household income?", min_max=(0, 1000000), recodes={ "0-19999": "Less than £20,000", "20000-29999": "£20,000 to £29,999", "30000-49999": "£30,000 to £49,999", "50000-69999": "£50,000 to £69,999", "70000+": "£70,000 or more", }, ) region = s.select_question( "Which region of the UK do you live in?", [ "London", "South East", "East of England", "South West", "North West", "East Midlands", "West Midlands", "Yorkshire and the Humber", "North East", "Wales", "Scotland", "Northern Ireland", ], ) s.set_quota( name="Age", quotas=[ s.quota("16-24", criteria=(16 <= age <= 24), quota=0.22), s.quota("25-34", criteria=(25 <= age <= 34), quota=0.26), s.quota("35-44", criteria=(35 <= age <= 44), quota=0.26), s.quota("45-54", criteria=(45 <= age <= 54), quota=0.26), ], ) s.set_quota( name="Gender", quotas=[ s.quota("Male", criteria=(gender == "Male"), quota=0.49), s.quota("Female", criteria=(gender == "Female"), quota=0.51), ], ) s.set_quota( name="Household Income", quotas=[ s.quota("0-19999", criteria=(income < 20000), quota=0.26), s.quota("20000-29999", criteria=(income >= 20000) & (income < 30000), quota=0.19), s.quota("30000-49999", criteria=(income >= 30000) & (income < 50000), quota=0.25), s.quota("50000-69999", criteria=(income >= 50000) & (income < 70000), quota=0.14), s.quota("70000+", criteria=(income >= 70000), quota=0.16), ], ) s.set_quota( name="Region", quotas=[ s.quota("London", criteria=(region == "London"), quota=0.13), s.quota("South East", criteria=(region == "South East"), quota=0.14), s.quota("East of England", criteria=(region == "East of England"), quota=0.09), s.quota("South West", criteria=(region == "South West"), quota=0.09), s.quota("North West", criteria=(region == "North West"), quota=0.11), s.quota("East Midlands", criteria=(region == "East Midlands"), quota=0.08), s.quota("West Midlands", criteria=(region == "West Midlands"), quota=0.09), s.quota("Yorkshire and the Humber", criteria=(region == "Yorkshire and the Humber"), quota=0.08), s.quota("North East", criteria=(region == "North East"), quota=0.04), s.quota("Wales", criteria=(region == "Wales"), quota=0.04), s.quota("Scotland", criteria=(region == "Scotland"), quota=0.08), s.quota("Northern Ireland", criteria=(region == "Northern Ireland"), quota=0.03), ], )