This article describes how to create a banner in Q using the drag and drop method or using code. Creating a banner can be helpful to see more than one question across columns when creating crosstabs. Other instances may require questions to be “nested”, with one layered beneath another, in order to see how data is split across different response options.
Method 1 - Drag and drop
- From the menu, go to Create > Banner > Drag and Drop...
- Start typing in the name of the first variable you'd like to use in the banner in the Find field. In this example, I will look for "collapse" because I want to use the "Age - Collapsed" variable.
- Drag and drop the variable into the Questions to include: window.
- Search for any additional variable(s) that you'd like to use in your banner in the Find field and drag and drop into the Questions to include next to the original variable. You can place the variable(s) to the right or left, depending on the order you desire.
- OPTIONAL: You can nest questions so that one is layered beneath another and you can see how the options are split further. Here, I'll add a variable that indicates if children are present in the household by searching for the variable via Find and drag and drop it beneath the "Age - Collapsed" variable:
You can customize your banner further with the following options/fields:
- Name - Name for the banner to be created.
- Table display options:
- Add sub-NETs - When checked, the NET of each question is also included in the banner.
- Add overall NET - When checked, a single NET is added to the end of the banner, representing the combination of all of the questions' categories. An alternative is to add a Total (see
[INSERT LINK HERE: Editing a banner by modifying a table]).
- Add column spans of question names - This causes the name of the question, or, where there are duplicates (see the comments above for Replace question name with span where there are duplicates), the name of the original question, to appear as a span, as shown on the example to the right.
- Dragging options:
- Duplicate questions dragged onto banner - When a question or variable is dragged into Questions to include a new question is automatically created in the Variables and Questions tab. This new question stores any modifications you make within the banner (eg, merging of categories or modifications to the Value Attributes. If Duplicate questions dragged onto banner is not ticked, a new question is not created, and any changes made in the banner will also be applied to other uses of the question in the project.
- Replace question name with span where there are duplicates - Q does not permit multiple questions to have the same name. Consequently, when a question is dragged onto the banner and duplicated, the new question is automatically created with a unique name. For example, the duplicate of Age will be called "Age 2". However, usually people will prefer to have the original name appear. Consequently, when Replace question name with span where there are duplicates is selected, Q automatically hides the name of the question and instead creates a new span using the original question name.
Method 2 - Custom Code
1. From the menu, go to Create > Banner > Code...
2. Update the Label to something appropriate for your first banner point. In this example, I will use "Young males".
3. Just below the Expression box, tick the Show value labels box.
4. In the Expression box, enter the logic, based on the criteria needed for the banner point. In my example for young males, I am defining it as:
Q2 = [Male] AND Q3 <= [25 to 29]
5. To create a new banner point, click on New at the bottom of the banner creator window.
6. Add a Label for the next banner point. In this example, I will add "Young females".
7. Below the Expression box, tick the Show value labels box.
8. In the Expression box, enter the logic, based on the criteria needed for the banner point. In my example for young females, I am defining it as:
Q2 = [Female] AND Q3 <= [25 to 29]
9. Continue adding new banner points as necessary with the required code for each. When done, click OK.
You will need to reference the value attributes (eg, "Male"). You can read more about creating logic variables here: [INSERT LINK HERE: Construct Logic Variable].
There are some tools that you can use to help you construct your formula and to check that it is correct.
If you right-click on one of the variables in the Find section, you have two options available:
- Values - This lets you see the values and categories that are available for this particular variable. This will help you work out what values to refer to in your expression.
- Insert reference - This will bring up a list of already built references that you can use as a starting point to building your formula.
Check the preview of results window:
For added assistance in ensuring that your logic has been set up correctly, refer to the Preview of results located at the bottom of the window. This will show you a list of all of the values for all of the variables that you have used in your formula. For example, in the screenshot above, it shows all the values for gender. Then, the Result column shows the value that the variable will take. I have ticked the Collapse duplicate inputs box to condense the results to make the final counts easier to read.
A value of 1 means the person in this new banner category, a value of 0 means they are not, and a value of NaN (missing data) means that the person is not included in the sample for this variable. You can show labels instead of numeric values by ticking the Show labels box.
NOTE: To edit an existing banner right-click on any banner point on an output, and go to BANNER > Edit or right-click any banner variable in the Variables and Questions tab and select Edit Banner.
Article is closed for comments.