next up previous contents
Next: 8.6 Item Refusal Codes Up: 8 GEIS Scripts Previous: 8.4 Item Type Overview   Contents


8.5 Self-Protection Statements

Specifying Logic Structures:

A GEIS script uses SPSs to specify question jumps. They are used to define the order in which script items are displayed or executed.

A SPS may consist of between 1 and 5 text lines, each of 200 characters in length. These are evaluated as if they formed a single logical statement 1000 characters long.

SPS can either be TRUE or FALSE. If a SPS evaluates to TRUE that item is deemed ``unprotected'' and is displayed. If a SPS evaluates to FALSE that item is deemed ``protected'' and is not displayed.

The example shown in Figure 23 is discussed below. In the example: ``='' means ``equal to''; ``NE'' means ``not equal to''; ``.'' means a missing answer.

Figure 23: Example of a simple question jump.
\includegraphics{/home/ross/research/GIS/GEIS/man/graphics/simple-jump-2.eps}



Evaluating Self-Protection Statements:

SPSs are evaluated as values are entered during interviews. When a value is entered the SPSs of subsequent items are evaluated to see if they are true or false. If true, they may be displayed; if false, they will not be displayed. If there is more than one subsequent item that evaluates to true, the item earliest in the script is one that is displayed.

During an interview, only the SPSs of those items which the compiler has previously determined are logically related to the current item, are examined. This is to avoid having to evaluate the SPSs of all following items. The related-items may be items that could become active, such as the next question to ask, or just items that make a reference to the current item.

SPSs may only refer to earlier items in a script, not later ones. Some items in a GEIS script do not have SPSs. These are TITL, the first item in an interview, and SCRP items.


Item Compatibility:

When a reference is made in a SPS to an item, the SPS expression must be compatible with the data type of the referenced item: numeric or character. For example, the item
Qone in Figure 23 is a CHCE item type. The possible answers to
Qone are `male' and `female', which are stored as numeric codes 1 and 2. This item must be referred to in a SPS by expressions such as Q1 NE ., Q1 EQ 1, and Q1 NE 2. It would be an error to use an expression such as Q1 EQ `female'.

Other item types store the answers as character data. In this case they are referred by expressions such as QC NE ` ' and QC EQ `ABC'.

Types that store numeric data are: CHCE, CBDT, CBTM, CHCE, DO, ENDD, HUP, INFO, LIST, LVLC, MAIL, NEW, NULL, NUM, NUMM, RST, TABL, TIME, and TRNF. Types that store character data are: MULT, OPEN, and STAT. Types that could store either numeric or character data are: CALC, LINK, and SCAL.


The MULT item:

MULT items14 are used to ask questions where there are several possible answer-options, and zero, one, or more answer-options may be selected. The responses are stored as a character string, such as ``0100111'' where `0' means a particular option was not selected and `1' means an option was selected.

Often references are made to the MULT item type to determine whether particular options have been selected. Suppose a MULT called QM had five options. It would store its response as ``ccccc'', where `c' could be `0' or `1', with `1' indicating the respective option had been selected. For example, if QM stored ``10101'' then this would indicate that the first, third, and fifth options of QM had been selected.

Suppose there was a subsequent item that was to be displayed only if the first, third, and fifth options of QM had all been selected. Its SPS would be QM=`10101'.

Alternatively, suppose there was a subsequent item that was to be displayed only if QMs third option had been selected regardless of the other options. Its SPS would be SUBSTR(QM,3,1)=`1'. In this expression, the function SUBSTR returns a substring from a larger character string. So SUBSTR('ABCDEFG',3,2) would equal ``CD''.


Error Messages:

Suppose a CHCE called QA with option codes 1, 2, 3, 4, and 5 has to be followed by another item that has the SPS QA=6. This SPS could never be evaluated to be true. So this item could never be displayed.

In this situation, when GEIS tries to move past this item in the interview it would find it had no other item to which it could move. It would then display the error message:

``Unable to jump. Check item and prior items answered.''
The interviewer would only be able to move backward but not forward in the script. The system log will contain more information that can be used to correct the error. Once the error is identified the script can be modified.


next up previous contents
Next: 8.6 Item Refusal Codes Up: 8 GEIS Scripts Previous: 8.4 Item Type Overview   Contents
Ross Corkrey 2006-02-14