bit

<< Click to Display Table of Contents >>

Navigation:  User guide > Constants >

bit

Every svar and mvar is considered to have a response length, which is the number of rows/columns it would generate if tabulated. A bit refers to a specific response in the variable, that is to a particular row or column within the variable. Bits are numbered from 1 up to the total number of possible responses defined in the variable.

In a svar only, bit can have the value 0 meaning none of the responses in the svar is true.

A svar can only ever have one response true at a time, and because of this it can be used in an arithmetic expression. In this case the svar is considered to have the value of the response which is true, or 0 if no response is true.

A colbin has 4095 responses, one for every possible combination of the 12 individual codes.

The following definition defines a new variable $PART using bits from existing variables:

dm $full=$123/1-9,

dm $part=$full/1,5,9,

The variable $PART is defined with 3 responses which are extracted from variable $FULL. When the second command is executed the values of responses 1,5 and 9 in $FULL are copied to responses 1,2 and 3 in $PART.

IMPORTANT: when referring to bits in a variable the responses are numbered 1 upwards regardless of where they originally came from:

dm $bfull=$156/6-9,$157/1-5,

dm $bpart=$bfull/4,5,

The two responses in $BPART originally came from $156/9 and $157/1. If you later wish to refer to the contents of $BPART you would refer to:

$bpart/1

or

$bpart/2