GB Genpop

Edited

You can insert this screener into your survey using

s.standard_screener("GB", "GenPop")

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

age = s.numeric_question(
    question="How old are you?",
    min_max=(18, 99),
    recodes={
        "18-24": "18-24",
        "25-34": "25-34",
        "35-44": "35-44",
        "45-54": "45-54",
        "55-64": "55-64",
        "65+": "65+",
    },
)

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("18-24", criteria=(18 <= age <= 24), quota=0.11),
        s.quota("25-34", criteria=(25 <= age <= 34), quota=0.17),
        s.quota("35-44", criteria=(35 <= age <= 44), quota=0.16),
        s.quota("45-54", criteria=(45 <= age <= 54), quota=0.18),
        s.quota("55-64", criteria=(55 <= age <= 64), quota=0.15),
        s.quota("65+", criteria=(age >= 65), quota=0.23),
    ],
)
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),
    ],
)

Was this article helpful?

Sorry about that! Care to tell us more?

Thanks for the feedback!

There was an issue submitting your feedback
Please check your connection and try again.