In this article
For example, you may have the following codes in your Age question:
- under 18 (code 1)
- 18 to 30 (code 2)
- 31 to 40 (code 3)
- 41 to 50 (code 4)
- 51 to 60 (code 5)
- Over 60 (code 6)
and would like to create a summary for the age groups ‘Up to 40’ (codes 1, 2 and 3) and ‘41 and over’ (codes 4, 5 and 6). In this case you must recode the Age question. Proceed as follows:
- In the Data Source Toolbox, right-click on the Age question and choose Recode Variable from the drop-down menu.
- Type a logical name for the recoded question into the Name field towards the top of the page.
- In the Categories area, in the text field to the right of the first category row, specify the text that is to be used for the first new category (in this case, "Up to 40")
- In the Answers area, select the answer options that are to be included in the first category, then click the >> button to allocate them to the category .
- Type into the text field the desired text for the second category. In this case call it for example "41 and older".
- In the Answers area select the remaining answer options, then click the >> button beside Category 2 to allocate them to this category .
- If you should require more categories in addition to the two provided by default, click the Add button for the category below which you wish to create the new category. Name the new categories and add the answer options as required.
- Save the changes.
The Single Recoded page opens .
Figure 1 - Example of the Single Recoded page
Figure 2 - Selecting the answers to be allocated to the new category
Notice that in the Categories area, each category has a Category ID (in the figure above, 1 and 2). When you allocate an answer option to a category, the Category ID is displayed beside the answer option in the Category ID column.
Figure 3 - The Category IDs
To delete a category, click the Remove button next to the category you wish to delete.
If you wish to move an answer from one category to another, select that answer in the Answers column and click Clear selected. This will remove the category ID assigned to this answer option, and you will be able to add this answer to any other category.
Once you have saved the recoded question, (1R) will be displayed next to the question in the Data Source Toolbox .(see the figure below). This indicates that this question has been recoded, and that one recoded variable exists for the question. Also, the Recoding Identifier label will be updated. This value is useful for Reportal script writers as it is used in scripts when referring to recodings. The identifier is autogenerated when creating a new Recoding and follows the pattern; rec0, rec1, rec2, etc.
Figure 4 - A Recoding specified in the Data Source
Note that you can recode a question more than once. To create an additional recoding, click the New button in the Single Recoded page toolbar and repeat the procedure above. All the recodings created for a question will after saving be listed in the drop-down list in the toolbar. The number of recodings against the question in the Data Source will be incremented as appropriate (for example (2R) or (3R)) so you can easily identify how many times a specific question has been recoded.
If you need to delete a recoding for a question, select in the drop-down list the recoding to be deleted, then click the Delete button in the Single Recoded page toolbar. The recoding will be deleted and the recoding indicator (for example 1R) will be decremented as appropriate.