Tables and axes > More about axes > Responses with numeric codes: bit
 
Responses with numeric codes: bit
Quick reference
To define elements whose data is to be read from an integer array created in the edit section, type:
bit array_name; element_text1;element_text2; ...
Using the statements field and bit together has the same effect as fld. You would use them when you want to reorganize or otherwise manipulate the data before tabulating it.
For more information about field, see Reading numeric codes into an array.
More information
field is an edit statement that counts the number of times a particular code appears in a list of fields for each respondent. It stores these counts in an integer array that consists of as many cells as there are fields to count. For example, if the questionnaire contains the question and response list:
Q6A: Which types of restaurant did you visit the last three times that you
     ate out?
 
(12-13)
(14-15)
(16-17)
Mexican  ....................
01
01
01
Indian  .....................
02
02
02
French  .....................
03
03
03
Italian  ....................
04
04
04
Mexican  ......-.............
05
05
05
you can use field to count the number of times each type of restaurant was visited by each respondent. If you call the array restaurant, restaurant1 contains the number of times that the respondent visited a Mexican restaurant, restaurant2 contains the number of times that they visited an Indian restaurant, and so on. If the respondent did not visit one of the restaurant types, the cell for that file is zero.
To tabulate data counted by a field statement, you use bit:
bit input_array; element_specs
The input_array is the name of the integer array you created with field, and element_specs are the element texts and codes. The rules for defining elements with bit is the same as for fld, so you could tabulate the restaurants by typing:
bit restaurants;Mexican;Indian;French;Italian;Chinese
Quantum increments the count for Mexican by 1 whenever cell 1 of the restaurants array is greater than zero. The value of a cell in the array has no bearing on the number by which Quantum increments the element count. As long as the cell value is greater than zero, Quantum increments the element count by 1. It does not increment the element count by the cell value; that is, it counts the number of respondents and not the number of responses.
Note If you want to count the number of responses, instead of the number of respondents, use the inc= option in the bit statement. For more information, see When bit is better than fld.
You can group and re-order responses in the same way as with fld. For example:
bit restaurants;Asian=2,5;American=1;European=3-4
Quantum increments the count for Asian whenever cells 2 and/or 5 are non-zero; it increments the count for American whenever cell 1 is non-zero; it increments the count for European whenever cells 3 and/or 4 are non-zero.
bit does not allow detailed analysis of out-of-range or non-numeric codes. The field statement counts out-of-range codes (for example, a code 6 or 7 when the array contains five cells) in cell zero which Quantum creates for itself. Non-numeric codes such as $&&$ for ‘None of these’ are stored in a cell which you define as part of the field statement. If you want to include these types of responses in the axis, use an element of the form Out of range=rej.
bit allows use of the keywords base, base=, hd= and tx=.
These are as described for fld.
See
When bit is better than fld
Incrementing tables more than once per respondent
See also
More about axes