Escolar Documentos
Profissional Documentos
Cultura Documentos
1 1
Objective At the end of the training program, participants should be able to understand
Run control statements Table control statements Axes control statements Defining axis using various methods Defining breaks using g&p statements and heading levels
The hierarchy
Tabulation section consists of three sets of control statements, viz.,
Table
Control Statements
Filters may be defined, applicable either to all tables in the run or to all tables defined before another general filter statement is read.
Titles are entered in various ways depending upon their position in the table. Footnote text is defined which is constant for all the tables in the run These statements are also called as a statement options
Output options determine the format of each table in the run, but have nothing to do with the numbers in each cell Data options determine how the cell counts are to be created but have nothing to do with the overall appearance of the tables
Examples: a;decp=1;wm=0;op=12;nopc;dsp;indent=0;nzrow;nzcol; +notype;flush;pagwid=200;paglen=59;spechar=-*; +side=30 You can switch off some of the options by adding no preceding the word Note: All the above mentioned options works on a/sectbeg/flt/tab Statements Does not cover completely. Refer to manual for complete list of options
9
Table control statements name the questions to be cross-tabulated against each other to create tables
Tables are requested by defining the axes to be tabulated on tab statements.
FORMAT: tab axis_name1 axis_name2;options In the above format, axis_name1 becomes the row/ side axis and axis_name2 becomes the column/ breakdown axis in the table
If required, tt statements may be placed after a tab statement. These titles will be printed in addition to the axis titles.
11
3 dimensional tables may be specified by placing a 3rd axis name after the tab keyword. This axis will act as a page filter. A table of the last 2 axes will be produced for each element of the 1st axis, and each table will be filtered by that element.
tab region age class will produce a table of age by class for each element of region. Each table will be filtered by the relevant element of region.
Be careful when using this future as it can generate large number of tables.
12
13
Example:
add Specifies a table to be added or combined with the table defined on the previous tab statement. Example: tab ax1 ax2 add ax5 ax6
div Defines the denominator of a table to be produced by dividing the table specified on the previous tab statement by that on the div line.
Example: tab ax07 bk01 div ax08 bk02
14
Defining Axes
Axes are the building blocks of a Quantum program
Broadly speaking, an axis is Quantums way of defining questions from the questionnaire
Each axis consists of statements which establish the conditions and text for the rows and columns of a table.
Axes are cross-tabulated by the tab statement to form tables Axes may be used to create the rows of a table or the columns of a table Every axis must have a name that is unique within your Quantum program. Axes usually contain a title for the question and the answers given to that question. The answers are usually called elements
16
Where: axis_name is the name of the axis Rules for axis names: May be up to 7 characters long May consist of letters, numbers and the _ character Must start with a letter Must be unique in the program
17
18
19
21
22
23
24
More on elements
Non-printing elements
It is sometimes necessary to create elements that will not be printed The n11 statement is a non-printing n10 (Base) statement. This is useful for re-basing figures part way through an axis, without printing the new base. The n15 statement is a non-printing n01 statement. Arithmetic elements Elements contain arithmetic values rather than counts. For example, number of times a product was bought rather than the number of people who bought it.
25
More on elements
Statistical elements
These elements contain totals, subtotals or statistical functions such as means and standard deviations.
26
More on elements
Statistical elements
n20 Sample Variance of the mean. The default for dec=2 n30 Medians. The default for dec=0 n04 Specifies an element containing sum totals of all n01, col and val statements in the axis n05 Calculates sub-totals starting from the previous n05, base row or the start of the table, whichever is the most recent
27
More on elements
Statistical elements
n20 Sample Variance of the mean. The default for dec=2 n30 Medians. The default for dec=0 n04 Specifies an element containing sum totals of all n01, col and val statements in the axis n05 Calculates sub-totals starting from the previous n05, base row or the start of the table, whichever is the most recent
28
Miscellaneous n statements
n00 Format: n00 [; c=condition]
Defines a global filter for an axis which is used in addition to those applied locally to individual elements
29
More on Axes
is a column number
opts: are keywords defining header and subheader texts and type of base required elm1 to elm2 : are the element texts p1 to pn: are the codes representing each element kwd: is a list of keywords preceded by percent signs
elmx=rej
31
tx=textDefines text only element when the axis is used as row axis. Any number of text-only elements may be defined anywhere on the col statement
Examples: 1. col 109; base;single;married;Divorced;Widowed 2. col 121;base;inner London=1;Outer London=2;England
+Outside London=3;Dk/Cs=rej32
Val statement
To define elements whose condition is that a variable contains a specific value, type:
val var;[opts];op;val1;[kwd];val2;[kwd];valn;[kwd];[text=rej] where var is a data, integer, real or real data variable
opts define heading, subheading and type of base op val1 to valn defines the type of numbers in the statement are ranges or single positive numbers
kwd is a list of option keywords separated by semicolons text=rej base op may be one of: i inclusive ranges (maximum value is a part of range) is an element for anyone not counted since the last
If the values on the val statement are just numbers which are incremented by 1 for each element, they may be abbreviated using the notation:
val c(m,n);base;=;start:end
Examples:
val c(215,218); base; i ; 0-3000; 3001-4000; 4001+ val c(110,111); base; hd=No.of People in the Household;=;1:9 val t5;=;type1=572; type2=835; r ; type3=400-500; +DK/NA=missing_ val c(110,111);base;hd=Size of Household;=;1 Person;2 People; + i ;3-4 People;5-6 People;7-8 People;9 or more People
34
35
define elements whose condition is that a field contains a specific numeric code, use
fld col.specs;[opts]; elm1 [=code[,code]][;%kwd];elm2[=code];[elmx=rej]
is a list of keywords preceded by percent signs is an element for anyone not counted since the last base
36
(ca1,ca2) :n
where ca1 and ca2 are the start columns of the fields to be read, and n is the field width
ca1,ca2 :n
where ca1 is the start of the first field in a sequential range of fields, ca2 is the start of the last field in that range, and n is the field width. Non-sequential groups of ranges may be listed one after the other as long as each group is separated by a slash
ca1/ca2:n
where ca1 and ca2 are single non-sequential fields, and n is the field width
37
38
39
40
More on g&p
In the above example, strictly speaking, there is no need to put element text on n01 statement since the text described on G statements is printed as columns in the table
However, the text showed here serves purpose in two ways will not lead to confusion referring to text described on G statement will get printed in case the break does not fit into the available column width The pagwid should be at least equal to side plus total width of the break
41