Pular para o conteúdo principal
Base de Conhecimento da FocusVision

Assigning Balanced Concepts in Quotas with Multiple Variables

Click here to learn more about quotas.

Quotas are used in almost every project. They are often used to help us achieve a fair and representative balance when showing concepts to a sample.

In this example, the quota system will assign each respondent a random concept marker based on the lowest bucket. The next respondent to take this survey will see Concept_3 because it has the least number of hits so far.

examples_quota_randompick.png

1:  Assigning Balanced Concepts in Quotas with Multiple Variables

Things get more complicated when you need to balance the concepts based on survey variables. For instance, it is often requested to have the concepts balanced by gender, age, and ethnicity.

In this example, there are 3 concepts that need to be balanced by gender, age, and ethnicity. The total sample size is 900 and each concept should be shown 300 times.

examples_quota_complicated.png

This setup can be achieved using the survey builder, but it would require more work than building the quota manually using a spreadsheet and cross-table markers.

A cross-table marker is a marker that can be counted across multiple tables in a single sheet. By default, this kind of setup will throw an error.

xtable_error.png

To get around this, you must add doit="1" as an attribute to all quota tags in the survey. This is the "SPECIAL OVERRIDE" mentioned above.

<quota sheet="concept_pick" doit="1" />

If using cross-table markers, cells: will not function.

Let's walk through an example where you need to balance a number of concepts between a number of variables to learn how this works.

1.1:  Overview

To accomplish this task, we will use the quota system and cross-table markers. Here are the steps we will need to take:

Step 1:  Create a quota sheet called "concept_picker"

Step 2:  Create a table called "Concepts" and set the limits for each concept to 300

Step 3:  Create a table called "Concepts x Gender" and create a marker for each gender and concept

Step 4:  Create a table called "Concepts x Age" and create a marker for each age and concept

Step 5:  Create a table called "Concepts x Ethnicity" and create a marker for each gender and concept

Step 6:  Compile the quota and add it to our project

1.2:  In Practice

The steps above can be accomplished using a spreadsheet editor like Microsoft Excel or LibreOffice Calc. First, we must define our markers in the "defines" sheet.

examples_quotas_definessheet.png

Now that we have created all of the necessary markers, we can create the "concept_picker" sheet.

examples_quota_conceptpicker.png

Note: For the sake of saving space, the ethnicity table is not shown. It is set up just like the Concepts x Age table.

This quota layout is all that is needed to fulfill the request. After we've uploaded our quota the project, we can make the quota call within our survey.xml as shown below.

<radio label="Q1" title="What is your gender?">
    <row label="r1">Male</row>
    <row label="r2">Female</row>
</radio>

<number label="Q2" size="3" title="What is your age?" />

<radio label="Q3" title="What is your ethnicity?">
    <row label="r1">African American</row>
    <row label="r2">Hispanic/Latino</row>
    <row label="r3">Caucasian</row>
    <row label="r4">Asian/Pacific Islander</row>
    <row label="r5">Other</row>
</radio>
<suspend/>

<term cond="not Q2.check('18-64')">Q2: Age less than 18 or greater than 64</term>

<quota sheet="concept_picker" doit="1"/>

<radio label="vConcept" where="execute" title="HIDDEN: What concept was chosen?">
    <exec>
for marker in xrange(3):
    if hasMarker("Concept_{}".format(marker+1)):
        vConcept.val = marker
    </exec>
    <row label="r1">Concept 1</row>
    <row label="r2">Concept 2</row>
    <row label="r3">Concept 3</row>
</radio>

Download the quota.xls file used in this example.  

1.3:  Results 

With data populated, you should notice that each concept is balanced by the appropriate categories and that no particular concept has been seen a bit more than others. Success!

Conclusion & Thoughts 

  • This may not be the exact solution you need for your balancing act. For example, we could have combined (nested) the gender, age and ethnicity concept tables together into a single table to achieve a different result.
  • Quotas can be built from the command line using text-to-spreadsheet conversion scripts like Xcell or XLShell.
  • Plus markers will not sync across tables when cells: is used. 
  • Este artigo foi útil?