Tables and axes > More about axes > col statement > Conditions on col statements
 
Conditions on col statements
Quick reference
To include a respondent in an element if the column contains codes for that element and no other, type:
col =number; ...
More information
The condition on an n01 statement can be any valid logical expression. This is not true for the col statement which can be used only when the conditions can be represented by the codes of one column. Nevertheless, the flexibility of col is increased by the fact that you can type = before the column number to mean ‘exactly equal to’. This is the same as writing a logical expression using cn=’p’.
For more information about the = operator in logical expressions, see Comparing data variables and data constants.
For more information about conditions on n01 statements, see Defining conditions for an element.
Suppose c114 contains information about the ages of children in the household as follows:
 
(c114)
Under 5 years
1
5 - 10 years
2
11 - 15 years
3
16 - 18 years
4
If the household contains children in more than one age group, the column will be multicoded. You might want to set up a table for people whose children are in one age group only; that is, they can have any number of children but they must all be under 5 or all aged 5 to 10; people with one child under five and one aged between 5 and 10 will be ignored. You can set up the table as:
l child1
col =114;Base;Under 5;Aged 5-10;Aged 11-15;Aged 16-18
The = includes respondents who have the specified code and no other codes in c114. It is the same as writing the condition c=c114=’1’. The first row after the base will be a count of all households having children under 5 only; the next row shows how many households have children aged 5 to 10 only.
See also
col statement