Tables and axes > Introduction to axes > Count-creating elements > n01 statement
 
n01 statement
Quick reference
To define one count-creating element, type:
n01[element_text] [;options]
These elements are sometimes called basic or totalizable elements.
More information
An n01 statement has three parts:
n01[text] [;options]
Each n01 in an axis creates one row/column/page in the table. In a row axis, this element might consist of several lines, depending on the types of figures requested.
Conditions are explained in Defining conditions for an element above. This example table shows how the elements were created.
Bread Purchase Survey Page 1
Absolutes/Col Percentages

Base: All Respondents
                                       Sex

Base Male Female
-------------------------------------
Base 200   44 156

Marital Status
Single 44   6 38
22.0%   13.6% 24.4%

Married 122   27 95
61.0%   61.4% 60.9%

Divorced 33   10 23
16.5%   22.7% 14.7%

Widowed 1   1 1
.5%   2.3% 0%
First, assume that marital status is coded as ‘1’ to ‘4’ in column 109 and that sex is a ‘1’ or a ‘2’ in c106. Next, you need to name the axes. Call them mstat and sex so that you know which questions they refer to. To set up the mstat axis, write:
l mstat
n01Single;c=c109'1'
n01Married;c=c109'2'
n01Divorced;c=c109'3'
n01Widowed;c=c109'4'
Deal with the sex axis in exactly the same way:
l sex
n01Male;c=c106'1'
n01Female;c=c106'2'
The first n01 in the axis mstat defines the element text as ‘Single’ and the condition as c109’1’. The element starts with the given text. It is printed exactly as it was written in the axis; to display it in uppercase or indented by two spaces, you write it in uppercase or precede it by two spaces on the n01 statement. Normally a semicolon separates the element text from the element conditions. If you want a semicolon as part of the element text, type in a backslash (\) before the semicolon, thus:
n01Hotels\;Guest Houses;c=c15'12'
Note Quantum normally allows 24 characters per line for text. Shorter texts are padded with blanks, longer ones are split at the nearest blank, hyphen (–) or slash (/) and are continued on the next line. You can reset the amount of space allocated to side texts using the option side= on the a, sectbeg, flt or tab statement or you can split long texts manually using one of the statements.
For information about setting side text widths with side=, see Output options in More about axes.
For information about splitting long row texts manually, see Subheadings and extra text
For information about setting break points in element texts in column axes, see Defining breakpoints in element texts.
The condition for single people states that only respondents having a ‘1’ in c109 will be included in the counts. Exactly which people are included in each cell of the row depends upon the column conditions. Cells in a table are created by the intersection of a row with a column. This creates an ‘and’ condition since the respondent must satisfy both the row and the column conditions to be included in that cell. Take, for example, the elements Single and Male. The cell created by their intersection has the condition:
c109'1' .and. c106'1'
There are six respondents satisfying this condition, so there are six men who are single.
See
Simplifying complex conditions
See also
Count-creating elements