The selectby
tag with the balance
method balances selections across multiple variables. It retrieves the current counts for each variable and selects the option that best optimizes balance using a "least squares" method.
The balanceby
tag is used with selectby: balance
to specify the questions/variables to be considered and "balanced" during the assignment process.
AGE. What is your age?
type: radio
1. Under 18
2. 18-24
3. 25-34
4. 35+
GENDER. What is your gender?
type: radio
1. Male
2. Female
PATH. Path assigned
type: coded single select
selectby: balance
balanceby: QAGE, QGENDER
1. Path 1
2. Path 2
3. Path 3
In the example above, QPATH assigns a path to each respondent by considering the distribution of completes across age brackets and genders, ensuring a balanced mix for each QPATH assignment.
Details
-
Variables using the
selectby: balance
method can be single-select or multiselect. Use themaxgroups
tag to assign multiple options. - The variables referenced by the
balanceby
tag must be single-select. Single-select quotas can also be used. - Questions with a
balanceby
tag are hidden from respondents and are punched by the system when the page it located on is submitted. - The
balanceby
tag can reference one or more variables as input. Note that referencing more variables increases the system resources required to run the process. - If a variable is balanced by multiple variables, it is possible to prioritize one of the variables by adding a numeric value in parentheses next to its name (e.g.,
balanceby: QAGE(2),QGENDER
).
Additional examples
Creating a multiselect variable
In the example below we use type: coded multiple select
to allow for more than one provider assignment. The maxgroups
tag limits the number of selections to '3'.
S1. In which country do you currently work?
type: radio
1. United Kingdom
2. United States
3. Canada
4. Ireland
5. Australia
setlist: PROV_LIST
1. Axeptio
2. CommandersAct
3. Didomi
4. Google Consent Management Solution
5. HubSpot
97. Other {autoother: y }
FORMER_PROV_SEL. Former Provider Selection
type: coded multiple select
maxgroups: 3
selectby: balance
balanceby: QS1
optsfrom: PROV_LIST
Assigning priorities
To prioritize one "balanceby" variable over another, use syntax such as: balanceby: QAGE(2), QGENDER
. In this example, the balance for QAGE is twice as important as for QGENDER.
Note, these values are relative to each other and do not affect or depend on quota assignments.
AGE. What is your age?
type: radio
1. Under 18
2. 18-24
3. 25-34
4. 35+
GENDER. What is your gender?
type: radio
1. Male
2. Female
PATH. Path assigned
type: coded single select
selectby: balance
balanceby: QAGE(2), QGENDER
1. Path 1
2. Path 2
3. Path 3
Comments
0 comments
Please sign in to leave a comment.