Documentation

Australia Genpop

You can insert this screener into your survey using

Code
s.standard_screener("AU", "GenPop")

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=(18, 99), recodes={ "18-24": "18-24", "25-34": "25-34", "35-44": "35-44", "45-54": "45-54", "55-64": "55-64", "65-99": "65+", }, ) gender = s.select_question("What is your gender?", ["Male", "Female", "Non-Binary", "Prefer not to say"]) income = s.numeric_question( "What is your annual income?", min_max=(0, 1000000), recodes={ "0-14999": "Less than $15,000", "15000-24999": "$15,000 to $24,999", "25000-49999": "$25,000 to $49,999", "50000-74999": "$50,000 to $74,999", "75000-149999": "$75,000 to $149,999", "150000+": "$150,000 or more", }, ) location = s.select_question( "Which state or territory do you live in?", [ "Victoria", "Queensland", "Tasmania", "Australian Capital Territory", "Northern Territory", "South Australia", "New South Wales", "Western Australia", ], ) s.set_quota( name="Age", quotas=[ s.quota("18-24", criteria=(18 <= age <= 24), quota=0.12), s.quota("25-34", criteria=(25 <= age <= 34), quota=0.19), s.quota("35-44", criteria=(35 <= age <= 44), quota=0.17), s.quota("45-54", criteria=(45 <= age <= 54), quota=0.16), s.quota("55-64", criteria=(55 <= age <= 64), quota=0.15), s.quota("65-99", criteria=(65 <= age <= 99), quota=0.21), ], ) 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="Income", quotas=[ s.quota("0-14999", criteria=(income < 15000), quota=0.06), s.quota("15000-24999", criteria=(income >= 15000) & (income < 25000), quota=0.07), s.quota("25000-49999", criteria=(income >= 25000) & (income < 50000), quota=0.20), s.quota("50000-74999", criteria=(income >= 50000) & (income < 75000), quota=0.17), s.quota("75000-149999", criteria=(income >= 75000) & (income < 150000), quota=0.30), s.quota("150000+", criteria=(income >= 150000), quota=0.20), ], ) s.set_quota( name="Location", quotas=[ s.quota("Victoria", criteria=(location == "Victoria"), quota=0.25), s.quota("Queensland", criteria=(location == "Queensland"), quota=0.20), s.quota("Tasmania", criteria=(location == "Tasmania"), quota=0.02), s.quota( "Australian Capital Territory", criteria=(location == "Australian Capital Territory"), quota=0.02 ), s.quota("Northern Territory", criteria=(location == "Northern Territory"), quota=0.01), s.quota("South Australia", criteria=(location == "South Australia"), quota=0.07), s.quota("New South Wales", criteria=(location == "New South Wales"), quota=0.32), s.quota("Western Australia", criteria=(location == "Western Australia"), quota=0.11), ], )