Rotations
Using the rotate compiler commands, you can create blocks of questions or response codes in a FIELD type question that will be presented to the interviewer or respondent in a different order for each interview. You may choose from three types of rotates. You may also rotate some or all of the questions or codes in a block, and may have a Rotate block within another Rotate block (this is called a Nested Rotate). There is a default limit of 10,000 questions within the outermost level of the rotate. This includes all compiler commands, other rotate commands, etc. To increase the limit, use the header option MAXIMUM_QUESTION_SIZE.
A Rotate block must start with a ROTATE compiler statement and end with an ENDROTATE compiler statement.
The syntax for a ROTATE compiler statement is:
{!ROTATE,type,# per group,controlling label or data location}
The rotate type is required, but the number in group and controlling label are all optional; although Survox recommends using a controlling label. The rotate type specifies how the questions will be rotated:
- SCRAMBLE – A scramble rotate asks the questions or codes in random order each time. It is possible, but unlikely, that questions or codes will be asked in the same order twice in a row. Survox recommends using this type 99% of the time since it’s a true randomization.
- FLIP – A flip rotate asks the questions or codes in either the original order or reverse order of the rotate series. The first time through may start at either the top or the bottom of the set of questions or codes. The second time around the questions or codes are asked in the opposite order. The third time around the questions or codes are asked in the first order, etc. (e.g., 1st time: 1,2,3; next time: 3,2,1; next: 1,2,3). This is good to use with a few questions or response codes.
- REGULAR – A random start rotate starts at a random question or code in the block (per interviewer, per session), and asks the questions or codes sequentially from that point until all the questions or codes in the block have been asked. In the next interview, with the same interviewer in the same session, the first question or code asked will be the next one of the rotate series (e.g., 1st time: 3,4,1,2; next time: 4,1,2,3; next: 1,2,3,4, etc.). Survox does NOT recommend using this type unless absolutely necessary. This is not a true randomization.
If you have a standard number of questions or response codes to keep together when rotating, you may specify this. This number must divide evenly into the total number of questions or codes rotated. You may, for example, have ten questions or codes in a rotate block and want every two to be rotated together.
Specifying a number per group is optional; the default number is 1. See the GROUP command for more flexibility in keeping questions or codes together.
Rotates can be controlled by a number in the data. For instance, you could direct the program where to start the rotate for a scramble rotate. This is specified by using a GENERATE, VARIABLE (subtype NUMERIC_ONLY), NUMERIC, or EXPRESSION statement to generate a number, and referring to that question’s label or location on the ROTATE compiler statement. You can also control rotates by specifying a label for the ROTATE compiler statement itself and then referring to it as the controlling label for other rotate statements. In this way you will be using the number that the program puts in the data rather than generating one yourself with one of the statements mentioned earlier in this paragraph.
Specifying a controlling label in a ROTATE compiler statement is optional. If you specify a blank data location, PREPARE will store the rotate information in that field. The field used will be stored in the DB file as a variable that you can run reports off of.
You can’t set a rotate seed for an internal rotate once you are inside the external rotate; when the external rotate is read, rotate controllers are set within the rotate, and changes in the data will not change the rotate. All controllers must be set prior to the execution of the outermost rotate.
ROTATE compiler statements use data columns. A warning message is given if any hardcoded data columns are going to be overwritten. Here are the number of columns used by each, and what goes into those columns:
- SCRAMBLE – A 10-column field holds the generated number which is a “seed value” that is used by the program to randomly assign the order.
- FLIP – A one-column field holds 1 to go forward or 2 to go backward.
- REGULAR – A three-column field holds the number of the question or code in the block that the rotate will start with (this will be a number in the range of 1 to the number of questions or response codes).
NOTE: It’s best practice to use the RESUME_HERE and RESUME_WHERE_AT compiler commands when rotating questions. The use of these will resume interviews properly in case the suspend was activated in the middle of a rotation block. For resumed interviews, put a {!RESUME_HERE} statement before each {!ROTATE}, and a {!RESUME_WHERE_AT} after each {!ENDROTATE} statement. This guarantees that all of the questions in a given Rotate block will be executed when the interview is resumed.
Controlling Rotate Sequence During an Interview (Rotate Seeds)
Scramble rotations gets its seed from the system clock. Using a controlling question, you can have the program control two rotates in exactly the same manner. If you want the program to decide the sequence, but want two or more sections to rotate in the same manner, assign a label to the first rotate statement then refer to it as the controlling label in subsequent rotates. The program places a number that controls the rotate in the data. If you specify this same location or label as the controller for another rotate, the program will read the code from the specified data and treat the second rotate the same.
Flip rotations gets its seed from the question number of the last question in the block or from the last response code in the block; if odd, it rotates back to front, and even will rotate front to back in the same interview.
Unless you are assigning question numbers with this in mind, you must control the rotate sequences with a controller and then add a number to the controller to change the sequence for a particular block.
If you have multiple Random start Rotate blocks (Regular type rotate) then each block will get a different starting point.
NOTE: If you are rotating FIELD question response lists, a controlling question or data location (rotate seed) is required.
The syntax for an ENDROTATE compiler statement is:
{!ENDROTATE }
NOTE: If you choose to, you can label an ENDROTATE, so it is possible to GOTO it.
{ LABEL: !ENDROTATE }
EXAMPLE:
{!ROTATE,SCRAMBLE } { QFIRSTQUES: Do you like apples? !FIELD 1 Yes 2 No } . . { QLASTQUES: Do you like oranges? !FIELD [SAMEAS QFIRSTQUES] } {!ENDROTATE}
In this block the specified rotate type is a scramble rotate. No other options are specified. There is not a specified number of questions to be rotated together, and there is no controller question. The program will start at some question and ask all questions sequentially to the end of the block, then return to the beginning of the block and ask the questions up to the first one it asked.
EXAMPLE:
{!ROTATE,SCRAMBLE,3,USES } { QFIRSTQUES: Do you like apples? !FIELD 1 Yes 2 No } . . { QLASTQUES: Do you like oranges? !FIELD [SAMEAS QFIRSTQUES] } {!ENDROTATE}
In this block the specified rotate type is a scramble rotate. Every three questions will be rotated together, so the number of questions in the rotate block must be divisible by three (6, 9, 12, . . . ,30, etc.). The controller question is USES, so the rotate will be controlled by the number in that question. USES can be the location of a VARIABLE (subtype NUMERIC_ONLY), NUMERIC or EXPRESSION statement that generated the rotate controller or the name of a previous scramble rotate statement.
NOTE: You can skip out of a Rotate block but not into one.
FIX and GROUP Commands
You may have the need to keep some questions or response codes in the same order, or in the same position, even though they are within a Rotate block. The FIX and GROUP compiler commands let you control a portion of the rotate sequence. Both commands keep a series of questions or codes together, independent of any rotation. All questions or codes following the commands may be controlled by it (depending on whether a number in block is specified), up to the next relevant compiler command (ENDROTATE, FIX, or GROUP) at the same rotate level. Or, the command may specify the number of questions or codes to keep together as a set. (Any subsequent questions or codes get grouped according to the number specified on the ROTATE command.)
The FIX command fixes the position of a series of questions or response codes in a Rotate block. If, for example, the first question in a Fix block is the third question in the rotate, then that question, and the others in its block, will always be asked in the third position.
The syntax for a FIX command is:
{!FIX,number in block}
If the number in block is omitted, all questions or codes up to the next relevant compiler command at the same rotate level are fixed. If the number in block is specified, that number cannot include other rotate commands.
The GROUP command keeps a series of questions or response codes together, without fixing them in the same position each time (as the FIX command does). The questions or codes will be asked as a group, in the same order each time, but not in the same position in the rotate block.
The syntax for a GROUP command is:
{!GROUP,number in block}
If the number in block is omitted, all questions or codes up to the next relevant compiler command at the same rotate level are grouped together. If the number in block is specified, that number cannot include other rotate commands.
If you have a nested rotate block (i.e., a rotate block within a rotate block), you can only specify a number in block for FIX or GROUP at the lowest (innermost) level.
Survox recommends that you put the GROUP command around all sets of questions and avoid use of specific numbers per group on ROTATE statements. This gives you more flexibility, allowing quick last minute changes.
EXAMPLE:
{!ROTATE,SCRAMBLE } { QFIRSTQUES: . { QSECONDQUES: . { QTHIRDQUES: . {!GROUP,5} { STREET: WHAT IS YOUR STREET ADDRESS? !VARIABLE,,25,1 } { APARTMENT: Is there an apartment number? !VARIABLE,BLANK_OK,6,1 } { CITY: What city is that in? !VARIABLE,,30,1 } { STATE: What state? !VARIABLE,,2,2 } { ZIPCODE: What is your zipcode? !VARIABLE,NUMERIC_ONLY,5,5 } { NINTHQUES: . { TENTHQUES: . { ELEVENTHQUES: {!ENDROTATE}
In this block, This is a scramble rotate. There are a total of eleven questions in the block. The questions will be asked in scrambled order except for the five questions following the GROUP command—these questions will be asked in this order every time. However, the block may appear on the screen as the first question, the fifth question, etc.
With this example, the questions’ position within the Rotate block is not important. However, their positioning could be controlled with a FIX command. If the above GROUP command were instead a FIX command, the series of five questions starting at STREET would always be asked as the fourth through eighth questions regardless of the order of the other questions.
You can have Rotate blocks within other Rotate blocks, up to five levels deep. Each of the ROTATES requires its own ENDROTATE. The first ENDROTATE will close off the closest ROTATE. There is virtually no limit to the number of questions in a Rotate block. This applies to both rotating questions and response codes.
Example:
{ ROTSEED: HIDE !VARIABLE,NUMERIC_ONLY,10,10 } { QSIMPLE: Simple Rotation Example !FIELD,,MAXIMUM_RESPONSES=10 !ROTATE,SCRAMBLE,,ROTSEED 01 Item 1 02 Item 2 03 Item 3 04 Item 4 05 Item 5 06 Item 6 07 Item 7 08 Item 8 09 Item 9 10 Item 10 !ENDROTATE }
In this example, the FIELD list items are being rotated using a scramble rotate. A controlling question or data location is required. The ROTATE statement goes on the next line after the FIELD type and the ENDROTATE goes after all items in the rotation block.