• No results found

Quantum User's Guide - Vol2

N/A
N/A
Protected

Academic year: 2021

Share "Quantum User's Guide - Vol2"

Copied!
346
0
0

Loading.... (view fulltext now)

Full text

(1)

Quantum User’s Guide

Volume 2 Basic Tables

(2)

COPYRIGHT  2000 BY SPSS LIMITED

All rights reserved as an unpublished work, and the existence of this notice shall not be construed as an admission or presumption that publication has occurred. No part of the materials may be used, reproduced, disclosed or transmitted to others in any form or by any means except under license by SPSS Ltd. or its authorized distributors. SPSS Limited Maygrove House 67 Maygrove Road LONDON NW6 2EG England

Please address any comments or queries about this manual to the Support Department at the above address, or via e-mail to: [email protected]

(3)

Contents / i

Contents

List of figures ...v

About this guide ... vii

1 Introduction to the tabulation section...1

1.1 Creating tables ...1

Creating the cells of the table ...2

Types of data in the cells ...3

Table text ...5

2 The hierarchy of the tabulation section...7

2.1 Components of a tabulation program ...7

2.2 Hierarchies of Quantum ...8

2.3 Defining run conditions ...8

Options on a, sectbeg, flt and tab statements ...9

Switching off options ...32

2.4 The default options file ...32

2.5 Sample tables ...33

Total percentages ...33

Cumulative column percentages ...34

Indices ...35

Table of means ...36

3 Introduction to axes...39

3.1 Naming the axis ...39

3.2 Types of elements within axes ...45

3.3 Defining conditions for an element ...46

Special conditions ...48

3.4 Count-creating elements ...49

The n01 statement ...50

The n15 statement ...56

Creating a base ...56

3.5 Subheadings and extra text ...57

Statements for extra text ...58

Subheadings in the axis ...62

Text continuation statements ...66

3.6 Netting ...67

Automatic indentation of element texts ...70

Text-only net elements ...71

Accumulation of suppressed elements by net level ...72

Percentaging with nets ...73

3.7 Axes within axes ...76

Defining subaxes ...77

Creating tables from subaxes ...80

(4)

Quantum User’s Guide Volume 2

ii / Contents

4 More about axes... 83

4.1 The col statement ... 83

Continuing col statements ... 85

Dealing with don’t knows ... 86

Conditions on col statements ... 86

Bases on col statements ... 87

Subheadings with col ... 88

Text-only elements with col ... 88

4.2 The val statement ... 89

Testing for arithmetic equality ... 89

Testing ranges ... 92

Combining arithmetic equality and range testing ... 93

Counting missing values ... 94

4.3 Responses with numeric codes: fld ... 94

4.4 Responses with numeric codes: bit ... 97

When bit is better than fld ...99

Incrementing tables more than once per respondent ... 99

4.5 Filtering within an axis ... 102

4.6 Redefining a base ... 103

4.7 Pagination ... 105

Automatic pagination ... 105

Manual pagination ... 108

Repeating elements on continued tables ... 109

4.8 Options on n, col, val, fld and bit statements ... 112

Output options ... 113

Data options ... 119

4.9 Percentage differences ... 125

4.10 Distributing records from one element across the axis ... 129

5 Statistical functions and totals... 133

5.1 Creating totals ... 133

5.2 Statistical statements ... 136

5.3 Averages ... 137

5.4 The mean, standard deviation, standard error and error variance ... 138

5.5 The n25 statement ... 139

Using factors ... 140

Using n25;inc= ... 142

Weighted runs ... 143

5.6 The sum of factors ... 144

5.7 Creating percentiles and medians ... 144

Percentiles from factors ... 145

Percentiles based on numeric variables ... 149

Interpolation with percentiles ... 151

5.8 Printing the effective base ... 153

5.9 Formulae ... 155

Sum of factors ... 156

Mean ... 156

Standard deviation ... 156

(5)

Quantum User’s Guide Volume 2

Contents / iii

Sample variance of the mean ... 157

6 Using axes as columns... 159

6.1 Maximum width for column headings ... 159

6.2 Fully automatic set-up ... 160

6.3 Defining breakpoints in element texts ... 163

6.4 Defining column widths with colwid= ... 164

6.5 Manual set-up ... 164

The banner text ... 165

Spacing for groups of g statements ... 166

6.6 Printing numbers in columns ... 167

6.7 Underlining column headings ... 168

6.8 Splitting large tables ... 169

7 Creating tables... 171

7.1 Creating a table ... 171

Multidimensional tables ... 171

7.2 Options on the tab statement ... 174

Cross-tabulating data variables ... 175

7.3 Multilingual surveys ... 176

7.4 The and statement ... 178

7.5 Combining tables ... 179

Horizontal and vertical combination ... 179

Adding tables ... 182

Dividing one table by another ... 186

7.6 Printing more than one table per page ... 188

A set of short tables that do not exceed the page width ... 190

Short tables with wide breakdowns ... 190

Paper saving ... 191

Controlling titles, footnotes and bottom text ... 191

Pasting one table underneath another ... 195

Logical and physical page numbers ... 196

7.7 Suppressing percentages and statistics with small bases ... 196

What are ‘percentages’ and ‘statistics’? ... 197

Requesting suppression ... 197

How suppression works ... 198

Examples ... 199

8 Table texts... 203

8.1 Table titles ... 203

Titles for T statistics tables only ... 206

8.2 Underlining titles ... 207

8.3 Printing text at the foot of a table ... 208

8.4 Printing text at the bottom of a page ... 210

8.5 Table numbers ... 210

8.6 Page numbers ... 213

(6)

Quantum User’s Guide Volume 2

iv / Contents

9 Filtering groups of tables... 217

9.1 General filter statements ... 217

9.2 Named filters ... 220

9.3 Nested filter sections in table specs ... 221

10 Include and substitution... 225

10.1 Filing and retrieving statements ... 225

10.2 Filing and retrieving non-identical statements ... 227

Symbolic parameters for columns ... 228

Symbolic parameters for codes ... 232

Symbolic parameters for text ... 234

Symbolic parameters for variables ... 235

10.3 Assigning global values to symbolic parameters ... 237

10.4 Grid tables ... 238

Grid axes ... 238

#def with grids ... 243

Options in grid axes ... 243

Cross-tabulating grid axes ... 244

Grid axes in levels jobs ... 245

Weighted grids ... 246

10.5 Filtered columns in grid tables ... 247

10.6 Exporting grid axes in Quanvert ... 249

Reading non-standard data files ... 250

11 A sample Quantum job... 253

A Limits... 265

B Error messages... 271

B.1 Compiler errors ... 271

B.2 C Compiler errors ... 296

Code segment too large ... 296

B.3 Datapass errors ... 297

Array dimension error ... 297

B.4 Accum Errors ... 297

B.5 Qout Errors ... 299

nums ran out early ... 299

C Options in the tabulation section... 301

(7)

Figures / v

List of figures

1.1 Simple table of marital status by sex ... 1

1.2 Table of marital status by sex filtered by region ... 3

1.3 Counting respondents who satisfy an arithmetic condition ... 4

1.4 Incrementing cells using values read from the data ... 5

2.1 Total percentages ... 33

2.2 Cumulative column percentages ... 34

2.3 Indices created with op=8 ... 35

2.4 Table of means ... 37

3.1 Creating elements with n01 statements ... 50

3.2 Table for product tests ... 55

3.3 Using coltxt to print text above/below cell counts ... 62

3.4 Percentages against nets ... 74

3.5 Percentages against nets and the table base ... 76

4.1 Creating elements with val ... 90

4.2 Using n00 as a filter in an axis ... 104

4.3 Table using inc= ... 122

5.1 Totals and subtotals ... 135

7.1 Multidimensional table ... 173

7.2 Wide table with squeeze=1 ... 192

7.3 Wide table with squeeze=2 ... 194

7.4 Table with small percentage suppression and T statistics ... 201

8.1 Table titles printed with ttg ... 204

10.1 Grid table ... 242

10.2 Filtered columns in grid tables ... 248

(8)
(9)

About this guide / vii

About this guide

The Quantum User’s Guide is written primarily for Quantum spec writers. It is also a useful reference for Quanvert database administrators and others who prepare data for use with Quanvert or Quanvert Text.

This guide is not intended as a tutorial or teach-yourself document. Instead, it provides a complete and detailed description of the Quantum language and the Quantum programs. However, the guide has been designed with your needs in mind. If you are an experienced user, you will find the Quick Reference boxes at the start of each section helpful as a reminder of syntax. If you are less experienced, you will probably prefer the more detailed explanations and examples in the main body of each section.

The Quantum User’s Guide is divided into four volumes, which are described in more detail below. All the volumes contain a comprehensive index that covers all four volumes.

Volume 1, Data editing

Volume 1 of the Quantum User’s Guide covers data editing, validation and cleaning:

• Chapters 1 to 3 give you an overview of the language and explain the basic concepts of Quantum spec writing.

• Chapter 4, ‘Basic Elements’, describes constants, numbers and variables. • Chapter 5, ‘Expressions’, describes arithmetic and logical expressions.

• Chapter 6, ‘How Quantum reads data’, describes types of records, data structure, trailer cards, reserved variables, merging data files and reading non-standard data files.

• Chapter 7, ‘Writing out data’, describes creating a new data file, copying records to a print file, and writing to a report file.

• Chapter 8, ‘Changing the contents of a variable’, describes the Quantum assignment statements, adding and deleting codes in a column, forcing single-coded answers, setting a random code in a column, reading numeric codes into an array and clearing variables.

Chapter 9, ‘Flow control’, describes the if and else statements, routing around statements, loops, rejecting records, jumping to the tabulation section and canceling the run.

• Chapter 10, ‘Examining records’, describes holecounts and frequency distributions.

Chapter 11, ‘Data validation’, describes the require statement, column and code validation, and validating logical expressions.

(10)

Quantum User’s Guide Volume 2

viii / About this guide

• Chapter 12, ‘Data correction’, describes forced cleaning, on-line data correction, creating clean and dirty data files, correcting data from a corrections file, and missing values in numeric fields.

• Chapter 13, ‘Using subroutines in the edit’, describes how to call up subroutines, the subroutines in the Quantum library, writing your own subroutines and calling functions from C libraries.

• Chapter 14, ‘Creating new variables’, describes how to name and define variables in your Quantum spec.

• Chapter 15, ‘Data-mapped variables’, describes the data-mapped variables feature.

• Chapter 16, ‘Running Quantum under Unix and DOS’, describes how to compile and run your Quantum program.

Volume 2, Basic tables

Volume 2 of the Quantum User’s Guide covers axes and creating basic tables:

• Chapter 1, ‘Introduction to the tabulation section’, provides an introduction to creating tables in Quantum.

• Chapter 2, ‘The hierarchy of the tabulation section’, describes the components of a tabulation program, the hierarchies of Quantum, how to define run conditions, the options that are available on the a, sectbeg, flt and tab statements, the default options file and some sample tables.

• Chapter 3, ‘Introduction to axes’, describes how to create an axis, the types of elements within an axis, how to define conditions for an element, the n count creating elements, subheadings, netting and axes within axes.

Chapter 4, ‘More about axes’, describes the col, val, fld and bit statements, filtering within an axis, and options on axis elements.

• Chapter 5, ‘Statistical functions and totals’, describes totals, averages, means, the standard deviation, standard error and error variance statements and how to create percentiles.

• Chapter 6, ‘Using axes as columns’, describes special considerations for when axes are used for the columns of a table.

Chapter 7, ‘Creating tables’, describes the syntax of the tab statement, multidimensional tables, multilingual surveys, combining tables, printing more than one table per page, and suppressing percentages and statistics with small bases.

(11)

Quantum User’s Guide Volume 2

About this guide / ix • Chapter 8, ‘Table texts’, describes table titles, underlining titles, printing text at the foot of a

page, table and page numbers and controlling table justification.

• Chapter 9, ‘Filtering groups of tables’, describes general filter statements, named filters and nested filter sections.

• Chapter 10, ‘Include and substitution’, describes filing and retrieving statements, symbolic parameters and grid tables.

• Chapter 11, ‘A sample Quantum job’, provides an example of a Quantum specification and the tables it produces.

• Appendix A, ‘Limits’, describes the limits built into Quantum.

• Appendix B, ‘Error messages’, contains a list of compilation error messages with suggestions as to why you may see them and how to solve the problems which caused them to appear. • Appendix C, ‘Options in the tabulation section’, provides a summary of the options available

in the tabulation section.

Volume 3, Advanced tables

Volume 3 of the Quantum User’s Guide covers advanced tables and statistics:

• Chapter 1, ‘Weighting’, describes the weighting methods that you can use in Quantum. • Chapter 2, ‘Row and table manipulation’, describes how to create new rows and tables using

previously created tables or parts of previously created tables.

• Chapter 3, ‘Dealing with hierarchical data’, describes how to use analysis levels in Quantum. • Chapter 4, ‘Descriptive statistics’, describes the axis-level and table-level statistical tests that

are available in Quantum and provides details of the chi-squared tests, non-parametric tests on frequencies and Friedman’s two-way analysis of variance.

• Chapter 5, ‘Z, T and F tests’, describe the Z, T and F tests that are available in Quantum. • Chapter 6, ‘Other tabulation facilities’, describes how to include C code and edit statements in

the tabulation section and how to sort tables.

• Chapter 7, ‘Special T Statistics’, describes the special T statistics that are available in Quantum.

• Chapter 8, ‘Creating a table of contents’, describes how to create a formatted list of the tables that are produced by a Quantum run.

(12)

Quantum User’s Guide Volume 2

x / About this guide

• Chapter 9, ‘Laser printed tables with PostScript’, describes how to convert the standard tabulation output into a file suitable for printing on a PostScript laser printer.

• Appendix A, ‘Options in the tabulation section’, provides a summary of the options available in the tabulation section.

Volume 4, Administrative functions

Volume 4 of the Quantum User’s Guide covers administrative functions:

• Chapter 1, ‘Files used by Quantum’, describes files you may need to create in order to use certain Quantum facilities, including the variables file, the levels file, the default options file, the run definitions file, the merges file, the corrections file, the rim weighting parameters file, and the C subroutine code file, aliases for Quantum statements, customized texts, and user-definable limits.

• Chapter 2, ‘Files created by Quantum’, describes many of the files created during a run and draws your attention to those of particular interest.

• Chapter 3, ‘Quantum Utilities’, describes how to tidy up after a Quantum run and how to check column and code usage.

• Chapter 4, ‘Data conversion programs’, describes the q2cda and qv2cda programs that convert tables into comma-delimited ASCII format, the qtspss and nqtspss programs that convert Quantum data into SPSS format, and the qtsas and nqtsas programs that convert Quantum data into SAS format.

• Chapter 5, ‘Preparing a study for Quanvert’, describes the tasks you need to perform before converting a Quantum spec and data file into a Quanvert database.

• Chapter 6, ‘Files for Quanvert users’, describes files that are specific to either Quanvert Text or Windows-based Quanvert.

• Chapter 7, ‘Creating and maintaining Quanvert databases’, describes how to create and maintain Quanvert databases.

• Chapter 8, ‘Transferring databases between machines’, describes how to transfer databases between machines and the programs provided to help you achieve this.

• Appendix A, ‘Limits’, lists limits built into Quantum.

• Appendix B, ‘Error messages’, contains a list of compilation error messages with suggestions as to why you may see them and how to solve the problems that cause them to appear. • Appendix C, ‘Quantum data format’, describes the Quantum data format.

(13)

Quantum User’s Guide Volume 2

About this guide / xi • Appendix D, ‘Using the extended ASCII character set’, explains how you can use Quantum with

data that contains characters in the extended ASCII character set.

• Appendix E, ‘ASCII to punch code conversion table’, provides a table showing ASCII to punch code conversions.

• Appendix F, ‘Will this job run on my machine’, offers suggestions on how you can check whether a particularly large job will run on your computer.

Symbols and typographical conventions

Words which are keywords in the Quantum language are normally printed in italics in the text. In the main description of each keyword, the keyword is shown in bold the first time it is mentioned. When showing the syntax of a statement, as in the Quick Reference sections, all keywords are printed in bold. Parameters, such as question texts or responses, whose values are user-defined are shown in italics. Optional parameters are enclosed in square brackets, that is, [ ].

All examples are shown in fixed width type.

The ✎ symbol marks a note or other point of particular interest.

The ☞ symbol marks a reference for further reading related to the current topic.

Comments

SPSS MR welcomes any comments you may have about this guide, and any suggestions for ways in which it could be improved.

(14)
(15)

Introduction to the tabulation section – Chapter 1 / 1

1 Introduction to the tabulation section

When a record has passed through the edit without being rejected, it is passed to the tabulation section, if one exists. At this point, data, integer and real variables are available to create tables. The program deals with one complete record at a time (we’ll ignore trailer card records for the moment).

1.1 Creating tables

The tabulation section consists of a series of statements which determine the contents of the tables. Each table may be thought of as a matrix of cells. The table shown in Figure 1.1 below is a 3-by-5 cell table. It consists of three columns (Total, Male and Female) and five rows (Base, Single, Married, Divorced and Widowed) making fifteen cells in all.

Figure 1.1 Simple table of marital status by sex

SPSS MR Sample Table 1 Bread Purchase survey

Table 1 Page 1 Base: All respondents Absolutes

Total Male Female Respondents (c106’1’) (c106’2’) Base 200 44 156 (All Resps) Single 53 15 38 (c109’1’) Married 113 23 90 (c109’2’) Divorced 28 3 25 (c109’3’) Widowed 6 3 3 (c109’4’)

(16)

Quantum User’s Guide Volume 2

2 / Introduction to the tabulation section – Chapter 1

Creating the cells of the table

Each cell of this table is defined by two conditions, one from the row and one from the column. In this table the conditions which define each row and column are shown in parentheses. They are not, of course, printed in ordinary tables of output. The top left-hand cell contains 200 people. This is everyone in our sample, since the conditions creating this cell are ‘All Respondents’ and ‘Total Respondents’. The middle cell of the top row is defined by the conditions ‘All Respondents’ and ‘Male’, which is the condition that column 106 contains a ‘1’. The total number of male respondents is 44.

The second cell in the first column is defined by the two conditions ‘All respondents who are single’ and ‘All respondents’. A single respondent has a ‘1’ in column 109; there are 53 such respondents.

The second cell of the third row has the conditions Male (c106’1’) and Married (c109’2’). There are 23 married male respondents.

Each time a record passes through the tabulation section, the count in the top left-hand cell is increased by 1, since this cell is to include all respondents. Each time a record comes through in which c106 is a ‘1’, the count in the middle cell of the top row is also incremented by 1 since this cell includes all respondents who are males.

Conditions are positive rather than negative; respondents are included because they fulfil the required conditions rather than being excluded because they do not fulfil them.

Many tables contain counts that are created by the existence of more than two conditions. An entire table may be filtered. This means that no one is considered for inclusion in the table at all unless he or she fulfils a condition specified for the table as a whole. For example, we might wish to look at a table which includes only respondents who live in Central London. That condition is c121’1’ which is satisfied by 19 people as shown in Figure 1.2.

(17)

Quantum User’s Guide Volume 2

Introduction to the tabulation section – Chapter 1 / 3 Figure 1.2 Table of marital status by sex filtered by region

In the table in Figure 1.2, the count for each cell is defined by three rather than two conditions. The second cell of the third column, for instance, refers to all respondents living in Central London (c121’1’) who are female (c106’2’) and who are single (c109’1’). There are four people in this cell.

Types of data in the cells

Many table cells consist of counts created by a series of conditions or filters. As you can see from the examples above, these conditions are created by columns and codes in the general form cn’p’ (for example, c109’1’).

There are three other kinds of information that can be used to compute cells in a table:

• First, the conditions can be set up so that every time a record satisfies an arithmetic or numeric condition, the count in the cell is increased by one. You will normally do this when the question on the questionnaire requires a numeric response that will be entered directly into the data as it stands (e.g., age, number of products tried) rather than a response that will be represented in the data file by a specific code (e.g., Green=1, Red=2).

In Figure 1.3 we have set up age ranges so that every time a respondent whose age is, say, 45 passes through the tabulation section, the count in the relevant cell is incremented by 1. There are 30 respondents whose ages lie between 45 and 54, six of them men and 24 of them women. SPSS MR Sample Table 2

Bread Purchase survey

Table 2 Page 2 Base: All respondents Absolutes Living in Central London

Total Male Female Respondents (c106’1’) (c106’2’) Base 19 1 18 (All in C. Ldn) Single 4 0 4 (c109’1’) Married 13 0 13 (c109’2’) Divorced 1 0 1 (c109’3’) Widowed 1 1 0 (c109’4’)

(18)

Quantum User’s Guide Volume 2

4 / Introduction to the tabulation section – Chapter 1

Figure 1.3 Counting respondents who satisfy an arithmetic condition

• Second, there is arithmetic information itself. In the table in Figure 1.4 the contents of the cells are not counts of individuals fulfilling conditions; in this case, the base is the number of loaves of bread bought by all respondents who bought bread over the period of a month. The figures in the row reading ‘1 – 5 Loaves’ are the total number of loaves bought by those respondents who purchased between 1 and 5 loaves in that month. 94 loaves were purchased during the month by people who bought between 1 and 5 loaves altogether.

Tables of this type are generally created when the questionnaire requires the interviewer to write down the exact number the respondent says rather than circling a code representing a range of numbers. When the data is entered on the computer, the columns assigned to this question will contain the exact number the respondent gave — for instance, if he bought 15 loaves of bread, the number 15 will appear in the data rather than, say, a ‘3’ indicating that he bought between 10 and 15 loaves.

• Third, there are statistical functions such as means. At the bottom of Figure 1.4 we show the mean number of loaves bought per respondent who bought bread.

SPSS MR Sample Table 3 Bread Purchase survey

Table 3 Page3 Base: All respondents Absolutes

Total Male Female

Base 200 44 156 21 - 24 9 2 7 25 - 34 59 10 49 35 - 44 49 11 38 45 - 54 30 6 24 55 - 64 35 7 28 65 and Over 18 8 10

(19)

Quantum User’s Guide Volume 2

Introduction to the tabulation section – Chapter 1 / 5 Figure 1.4 Incrementing cells using values read from the data

Table text

The text associated with each table is created at various levels of the tabulation program. The text of each specific line (for example, Single, in the first example) is generally written on the same statement that defines the characteristics a respondent must have to be included in that line. Some text, such as the table title, (SPSS MR Sample Table 4, in Figure 1.4) is created at ‘table level’, while some is generated at the ‘run level’ so that it applies to all the tables in the current run. In our sample tables, this is the title ‘Bread Purchase survey’.

SPSS MR Sample Table 4 Bread Purchase survey

Table Page 4 Base: Number of Loaves Bought Absolutes

Base Male Female

Total Respondents 190 44 146

Who Bought Bread Number of Loaves Bought Base 2988 720 2268 1 - 5 Loaves 94 19 75 6 - 10 Loaves 319 33 286 11 - 15 Loaves 328 39 289 16 - 20 Loaves 427 225 202 21 - 25 Loaves 1266 291 975

(20)
(21)

The hierarchy of the tabulation section – Chapter 2 / 7

2 The hierarchy of the tabulation section

As was mentioned briefly in the previous chapter, the tabulation section is hierarchical in that characteristics can be defined at one level which will apply to that and all lower levels.

The aim of this chapter is to describe those levels and define simply their purpose in the run as a whole as a prelude to the more detailed discussions of the statements themselves in subsequent chapters.

2.1 Components of a tabulation program

A tabulation run consists of three sets of control statements:

Run control statements — these determine the overall characteristics of the run, and contain

the text which is constant for all tables. 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.

For further information about the run control statement (the a statement), see section 2.3, ‘Defining run conditions’.

For further information about the lower level filter statements (sectbeg and flt), see chapter 9, ‘Filtering groups of tables’.

For further information about titles and other text statements, see chapter 3, ‘Introduction to axes’, chapter 4, ‘More about axes’ and chapter 8, ‘Table texts’.

Table control statements — these name the questions to be cross-tabulated against each other

to create tables. In Quantum, these questions are called axes. The most important table control statement is the tab statement which lists the axes to be used to create an individual table. These statements may also specify the text and overall characteristics of each table.

For further information about the tab statement, see chapter 7, ‘Creating tables’.

Axis control statements — broadly speaking, these are Quantum’s way of defining questions

from the questionnaire. Each axis consists of a set of statements which establish the conditions and text for the rows and columns of a table. The two axes used to create the table shown in Figure 1.1 were sex for the columns and mstat (Marital Status) for the rows.

For further information about axis control statements, see chapter 3, ‘Introduction to axes’ and chapter 4, ‘More about axes’.

(22)

Quantum User’s Guide Volume 2

8 / The hierarchy of the tabulation section – Chapter 2

2.2 Hierarchies of Quantum

Quantum’s tabulation section consists of a series of levels, beginning with the lowest level, the line, and progressing upwards to the entire run. Within each of these hierarchical levels, conditions and characteristics can be specified for the current (and sometimes lower) level.

In many instances, characteristics specified at a higher level can be overridden by characteristics specified at a lower level. For instance, the cells in a line can consist of absolute figures, column percentages or row percentages, to name but a few. An option on the first run control statement (the

a statement) can cause all cells in all tables in the run to contain absolute figures.

The same option placed at the next level down (the tab statement) may state that the cells in this particular table only will show, say, column percentages. This option overrides the option on the a statement for this table only.

At the lowest level, the option on the a or tab statement can be overridden by an option on the statement creating a single line (i.e., an n, col, val, bit or fld statement). The option might specify that the line created by this statement will display absolute figures only rather than absolutes and column percentages.

These hierarchies greatly increase the flexibility of the tabulation program. However, they do mean that you must pay attention to what level you are on otherwise you may not get the results you expect.

2.3 Defining run conditions

Quick Reference

To define global and default conditions for the run, type: a;opt1[; opt2; ... ]

at the start of the tabulation section.

Global run conditions, if any, are defined on the a statement. If used, it must be the first statement in the tabulation section. Its format is:

a;options

where options are keywords defining the global characteristics of the run. You can use as many keywords as you like and you can list them in any order, but you must separate them with semicolons (;), for example:

(23)

Quantum User’s Guide Volume 2

The hierarchy of the tabulation section – Chapter 2 / 9 This statement tells Quantum that all rows will be double-spaced (dsp), cells will contain absolute figures and column percentages (op=12), the date will be printed on each table (date) and absolutes will be shown to one decimal place (dec=1). These and all other options are described below. Most options which are valid on the a statement are also valid on sectbeg, flt or tab statements. In this chapter, unless an option’s description specifically states that the option is not valid on particular statements, you may assume that the option is valid on a, sectbeg, flt and tab statements. Where a keyword appears on two or more of these statements, the setting at the lower level will override the setting at the higher level for that table or group of tables only. For example, if the same option is present with different values on a flt and a tab statement, the option on the tab will override the option on the flt for that table only. Similarly, where an option is present on both the

a statement and a flt, the option on the a statement will be overridden by the option on the flt until

another flt is read.

For further information about this concept of overriding options, see section 7.2, ‘Options on the tab statement’ and section 9.2, ‘Named filters’.

Options on a, sectbeg, flt and tab statements

Options can be divided into two categories: output options and data options. The former determine the format of each table in the run, but have nothing to do with the numbers in each cell, whereas the latter determine how the cell counts are to be created but have nothing to do with the overall appearance of the tables.

Jobs in which only the output options have been changed can be rerun without rereading the data, but jobs in which data options have been altered must be rerun just as if they were new jobs.

For further information on running Quantum, see chapter 16, ‘Running Quantum under Unix and DOS’ in the Quantum User’s Guide Volume 1.

(24)

Quantum User’s Guide Volume 2

10 / The hierarchy of the tabulation section – Chapter 2

Output options

Output options are those which affect the way your tables are formatted and printed. They do not determine how the data is tabulated or how the individual cell counts are calculated.

Unless otherwise stated, all options are valid on a, sectbeg, flt and tab statements.

For further information about analysis levels, see chapter 3, ‘Dealing with hierarchical data’ in the Quantum User’s Guide Volume 3.

Do not use baft with ttbeg=base since the two are incompatible.

For a full discussion about creating column headings, see section 6.5, ‘Manual set-up’.

acr100 This prints the text ‘100%’ on each cell of the base column when row percentages

are requested with op=0. Normally, a base column contains absolute figures only. If acr100 is used without row percentages, it is ignored.

anlev= Defines the analysis level at which axes are to be cross-tabulated in a hierarchical

(trailer card) job.

axttx This option creates table titles of the form ‘axis name by axis name’. x can be l

(lowercase L) for a title printed in the left, c for a title printed in the center of the line, r for a title on the right, or a number between 1 and 9 to have the title indented by ten times that amount of spaces. For instance axtt5 will indent the title by 50 spaces. You may also type axttg to have the start of the title lined up with the start of the column headings.

baft This keyword causes any table titles starting with the word ‘Base’ to be printed after all other titles for that table. If the keyword base appears on a

ttbeg/ttend/ttord statement and baft is also used, an error message is generated.

colwid=n Defines the width of columns in the printed tables where no p statements exist in

the column axis.

csort Sort tables column-wise (i.e., horizontal sorting rather than vertical row-wise

sorting).

date By default, tables are printed without a date. Use of the keyword date causes the current date to be printed in the top right-hand corner of each table. The date is in the format dd mmm yy; for example, 3OCT00.

dec=n This determines the number of decimal places for absolute figures. If dec= is not

(25)

Quantum User’s Guide Volume 2

The hierarchy of the tabulation section – Chapter 2 / 11

Remember that Quantum’s calculations are accurate to six digits only.

For information on the flt= statement, see section 9.2, ‘Named filters’.

decp=n This sets the number of decimal places required for percentages. The default is

decp=1 meaning one decimal place. This applies when op=0, 2, 7 or & (see below). Any number of decimal places are allowed, as long as you make each column wide enough to accommodate them.

dsp This leaves one blank line between each row of data in a table. Without this, one line follows directly underneath another.

flt=name Invokes the filter conditions and titles named on the flt= statement. If the filter

defines conditions, the rules governing data options apply. This option is valid on

sectbeg, flt and tab statements, but not on the a statement.

flush Causes rows containing percentages to be printed with the percentages directly

below the absolutes rather than one column to the right. Let’s say that a column contains an absolute figure of 39 which is 15.1% of the total. Here is the difference in the output between using and not using flush:

39 15.1% Without flush 39 15.1% With flush

As you can see, flush prints the right-most digits of the absolute and percentage figures one under the other; it does not print the percentage sign underneath the absolute number.

Where further adjustments are necessary, use pcpos= as described later in this section.

font=(ttype=fnum, ... )

You use this keyword when you want your tables to be printed in PostScript on a laser printer. font= defines the fonts in which various types of output are to be printed. Fonts are entered in the format shown above where ttype defines the text type and fnum is the number of the font (between 0 and 9) to be used for that text. Fonts and the numbers which represent them are defined on a per site basis: your system administrator will know what they are. Text types are:

def default font

a text following the a statement bot text following bot statements foot text following foot statements flt text following flt statements

(26)

Quantum User’s Guide Volume 2

12 / The hierarchy of the tabulation section – Chapter 2

For further information about laser printing, see chapter 9, ‘Laser printed tables with PostScript’ in the Quantum User’s Guide Volume 3.

tab text following tab statements tb table numbers

sidett titles after the row l statement

toptt titles after the column l statement

stub row element texts text n03 and n23 texts

banner g statement / column n01 texts

numb all numbers pc all percentages

colpc column percentages

rowpc row percentages

stats statistical row texts and numbers

page page text and numbers type output type text date the date

Text for which no font is defined is automatically printed in the standard laser printing font.

If most of the table is to be printed in the same font, you may define this font as the default font (using the text type def=). However, if this option is used, it must precede all other options.

Similarly, you may use the option pc to define a font for all percentage figures, but if you then wish to have row and/or column percentages in yet another font, the options rowpc and/or colpc must follow pc otherwise they will be overridden by the more general percentage font.

Let’s say that we have three fonts; 1 is standard type, 2 is bold and 3 is italic. We wish to have all run level titles (that is, those following the a statement) printed in a bold font and all percentages in italics. We would write:

a;font=(a=2,pc=3)

All other texts are printed in font number 1, the standard font.

Because of the way in which Quantum stores the font changes, tables to be laser printed must have a page width of 132 or 158 characters defined on the a statement.

Do not use font= if you do not want to use PostScript printing because it causes the font numbers to be printed on the right side of the tab_ file.

(27)

Quantum User’s Guide Volume 2

The hierarchy of the tabulation section – Chapter 2 / 13

For further information on graphics files, see chapter 2, ‘Files created by Quantum’ in the

Quantum User’s Guide Volume 4.

For further information, see section 7.6, ‘Printing more than one table per page’.

For further information, see section 7.3, ‘Multilingual surveys’.

graph= Produces SYLK format files for use with graphics or spreadsheet packages which

read this type of files (for example, Chart, Graphwriter for graphics and Symphony for spreadsheet applications). A separate file is created for each table containing the statements necessary to reproduce the table as a 2-dimensional bar chart.

By default, Quantum removes all base elements and only saves absolute figures. Table title are created from the row axis according to the hierarchy hd=, ttl, n23 using the first title found. If none of these types of title exists, a title of the form ‘row axis by column axis’ is generated, as in the axtt option. You may override any or all of these defaults by using the parameters listed below:

rb show row base figures. cb show column base figures.

pc show percentages only. Where tables are created with more than one type of percentage, the priority is column then row then total percents.

text graph title.

hitch= Prints the current table on the same page as the previous table if there is room for

the whole table on the page. If the current table has more than one page, Quantum prints its first page on the same page as the previous table.

indent=n Where a row text is longer than the space allocated to the row text in the table,

Quantum breaks the line in between words and continues the text on the next line. To have these continuation lines indented from the left margin, specify the amount of indentation required with indent=. Texts may be indented by between 0 and 15 spaces: the default is indent=0.

lang=xxx This is only valid on a and tab statements:

On the a statement, it specifies that this is a multilingual survey and xxx is the one to three character code of the default language.

On the tab statement, xxx specifies the language in which axis texts are to be printed.

When used on a tab statement, the default language must be specified on the a statement.

(28)

Quantum User’s Guide Volume 2

14 / The hierarchy of the tabulation section – Chapter 2

For information on manipulating elements and tables, see chapter 2, ‘Row and table manipulation’ in the Quantum User’s Guide Volume 3.

For an example and a more detailed explanation, see ‘Accumulation of suppressed elements by net level’ in chapter 3, ‘Introduction to axes’.

linesaft= Defines the number of blank lines to print after the last line of column headings.

The default is one blank line.

linesbef= Defines the number of blank lines to print before the first line of column headings.

The default is two blank lines.

manipz Apply spechar, nz, nzrow and nzcol to elements created using manipulation.

netsm Indicates that suppressed elements should be collected into an element flagged

with smsup+ only if that element is at the same level as the suppressed elements. For example, if an element at net level 2 is suppressed because its cell counts are below a given value, that element will only be included in the table if there is an element with smsup+ at level 2 into which it can be added.

Without netsm, suppressed elements will be added into the next smsup+ element regardless of whether it is at the correct level. Thus, an smsup+ element at level 2 may contain elements at level 2 and also any previously suppressed elements from level 1.

netsort This statement is valid on a and l statements only.

Requests that nets defined with the net statement should be sorted according to their net level. This means that nets at level 1 will be sorted and, within them, nets at level 2, and so on. Elements within a net are also sorted.

When netsort is used, each level below level 1 will be indented by 2 spaces per level — thus nets at level 2 are indented by 2 spaces (1×2 spaces); nets at level 3 are indented by 4 spaces (2×2 spaces). The elements comprising a net are indented by an additional two spaces.

The number of spaces indentation can be varied using netsort=n, where n is a whole number in the range 1 to 9, and is the number of spaces by which to indent. For example, netsort=3 will indent by multiples of 3 spaces. If a global indentation is set for all sorted tables of nets in the run, it may be turned off for an individual table by entering nonetsort or netsort=0 on the l statement for the table’s row axis.

(29)

Quantum User’s Guide Volume 2

The hierarchy of the tabulation section – Chapter 2 / 15

For netsort to work, the keyword sort must be present on the same statement as netsort or on a statement at a higher level. For example, to sort the nets in a single table, place netsort on the l statement of the row axis and sort on the a, sectbeg, flt or tab statement.

For examples of nets and sorted nets, see section 3.6, ‘Netting’ in this volume and section 6.3, ‘Sorting tables’ in the Quantum User’s Guide Volume 3.

For more details about subsorts, see ‘Sorting with subsort and endsort’ in chapter 6, ‘Other tabulation facilities’ in the Quantum User’s Guide Volume 3.

For further information, see section 7.8, ‘Overlapping data’ in the Quantum User’s Guide Volume 3.

For further information, see ‘Suppressing footnotes’ in chapter 7, ‘Special T statistics’ in the Quantum User’s Guide Volume 3.

For a description of how to create column headings with g statements, see chapter 6, ‘Using axes as columns’.

nooverlapfoot Suppress the footnote that is automatically printed on tables with special T-statistics run on overlapping data.

noprint Suppresses the printing of a table.

notauto Suppresses the automatic footnotes that describe which special T-statistics have

been applied to a table.

notbl Suppresses table numbers requested with tbl or tbr statements.

nzcol Suppresses the printing of columns where all cells are zero or round to zero.

When columns are suppressed in an axis whose column headings are defined on g statements, Quantum ignores the g statements and creates its own column headings using the texts defined on the elements themselves.

nzrow Suppresses the printing of rows where all cells are zero or round to zero.

op=n This keyword governs the type of output in the tables. Output types are:

& Total percentages. The value in the cell is percentaged against the number in the upper left-hand corner of the table (normally the base) rather than on the totals in the relevant column or row. If the table contains more than one base element, percentages are calculated using the leftmost figure in the most recent base element.

(30)

Quantum User’s Guide Volume 2

16 / The hierarchy of the tabulation section – Chapter 2

You may not request row and column ranks in the same table.

You may not request row and column ranks in the same table.

For an example, see section 3.6, ‘Netting’.

– Row rank figures are printed below each cell. Figures are ranked within rows, using 1 for the largest figure. Where two or more numbers have the same rank, they are all assigned the lowest rank possible. Thus, if the previous rank was 2 and the next value to be ranked occurs in the row three times, those numbers will all be ranked 5.

0 Row percentages.

1 Absolute figures (default). 2 Column percentages.

3 Column rank figures are printed below each cell. Figures are ranked within columns, using 1 for the largest figure. Where two or more numbers have the same rank, they are all assigned the lowest rank possible. Thus, if the previous rank was 2 and the next value to be ranked occurs in the column three times, those numbers will all be ranked 5.

5 Prints the text ‘100%’ on each cell of the base row.

6 Used with op=2 to produce two percentages for each cell. The first is the percentage of the cell against a redefined base, and the second is the percentage of the cell against the first base in the axis.

You might use this when you have a table showing which of two products people preferred, and their reasons for preferring this product. Percentages could be calculated against a redefined base such as ‘All preferring Brand A’. and then against the first base (all respondents).

7 Cumulative percentages.

8 Indices. The index for a cell is generated by dividing the row percentage in the cell by the row percentage in the base row. If the table contains more than one base row, indices are calculated using the row percentage in the most recent base row. It shows you how closely the percentages in the current row reflect those in the base row. The nearer the index is to 100%, the more closely the current row mirrors the base row.

(31)

Quantum User’s Guide Volume 2

The hierarchy of the tabulation section – Chapter 2 / 17 9 Prints absolutes and percentages side by side. Four columns are allocated to

the percentage if it has no decimal places; percentages with decimal places are allocated 5+decp columns (for example, seven columns for percentages

with decp=2).

When a cell contains absolutes and percentages and op=9 is not used, the absolute figure is printed on the top line with the column and row percentages on the second and third lines respectively.

94 This is a variation of op=9 which allocates three columns to percentages with no decimal places, and 4+decp columns where there are one or more decimal

places.

This can be useful for tables with very wide column axes where no column contains 100%.

When you create a table with more than one output type, Quantum prints the different values one under the other in each cell. If you’d prefer to have a separate table created for each output type (e.g., absolutes and column percentages as separate tables rather than both on the same table), enter the letter s in upper or lower case between the equals sign and the list of output types. For example: op=S012

creates three tables, one of absolutes (1), one of column percentages (2) and one of row percentages (0).

There is no significance in the order in which you list output types with op=. Quantum always prints them in the order shown below.

1 Absolutes

2 Col percentage on current base 6 Col percentage on first base 0 Row percentage

& Total percentage 8 Indices

–/3 Row or column ranks

Absolutes for tables of means/proportions (Quantum only) Proportions (Quanvert only)

Means (Quanvert only) Statistical probabilities Statistical flags

Percentage differences

Thus, although the example above specifies output types in the order row percentages (0), absolutes (1) and column percentages (2), the first page will show absolutes only, the second page will show column percentages only and the third page will show row percentages only.

(32)

Quantum User’s Guide Volume 2

18 / The hierarchy of the tabulation section – Chapter 2

Examples of tables containing some of these type of output can be found in section 2.5, ‘Sample tables’.

For information on percentage differences, see section 4.9, ‘Percentage differences’.

If your job uses a variety of page widths, you must ensure that the largest one is defined on the a statement. Additionally, if you will be laser printing tables using the font= option, the tables may be 132 or 158 characters wide only.

The exception is when you want Quantum to calculate percentage differences. In this case, the difference is calculated using the last percentage type named with

op=. For example, column percentages if op=012 is used.

page This option invokes automatic page numbering. Since this is the default — pages are numbered from 1 automatically — this option is generally used in its negative form of nopage which suppresses automatic page numbering.

paglen=n This determines the number of lines printed on each page. The default is

paglen=60 lines but any value between 10 and 10,000 is valid.

pagwid=n Normally tables can be up to 132 characters wide. pagwid= enables you to

decrease the page width or to extend it to a maximum of 10,000 characters.

pc This prints percent signs after percentage figures. This is the default, so this option is usually used negatively — nopc — to print percentage figures without percent signs.

pcpos=[±]n When Quantum prints percentages underneath absolutes, it offsets the percentages

by one column to the right of the absolutes. pcpos= is an extension of flush, provided so that you may determine more precisely where percentages are printed in relation to absolutes.

The number of columns to offset is defined by indicating the position of the right-most digit of the percentage in relation to the right-right-most digit of the corresponding absolute figure. Offsets of up to ±7 characters are valid. A negative value indicates positioning to the left of the absolute, while a positive value indicates positioning to the right. The default is pcpos=1 which has the same effect as noflush; pcpos=0 is the same as flush.

Here is a brief example to illustrate the effect of pcpos:

39 39 39

15.1% 15.1% 15.1%

pcpos=1 pcpos=0 pcpos=-1

(default) (same as flush)

(33)

Quantum User’s Guide Volume 2

The hierarchy of the tabulation section – Chapter 2 / 19

NA is printed in the same position as the decimal part of the percentage. By default this is one

character to the right of the absolute value.

For further information, see section 7.6, ‘Printing more than one table per page’.

For further details, see ‘Automatic pagination’ in chapter 4, ‘More about axes’.

pczerona Prints ‘NA’ instead of ‘0.0’ as the percentage in cells which have a zero base.

physpag Specifies that physical, rather than logical, page numbers are printed when using

hitch and squeeze.

printz This prints tables in which all cells are zero. Normally such tables are suppressed.

rinc Indicates that when a table is both too long and too wide to fit on one page, rows should take precedence over columns when the table is paginated. This means that Quantum will print all the rows on as many pages as necessary with the left-hand side of the column headings before repeating the process for the right-hand side of the column headings.

round Force row and column percentages to round to 100%. This option works only with

op=2 and op=0 and is ignored for op=6 and op=&. All op= options on the

elements of an axis are ignored for rounding purposes.

The option noround may be used on elements which may be totaled, (e.g., n01) to prevent them being altered in any way by the rounding process. n15 and n25 statements and nets are automatically assigned the default of noround.

When deciding which percentages may be altered to force the row and/or column percentages to round to 100%, Quantum adds up the absolute values in the relevant rows and/or columns (between bases if there are several bases). It then compares the result with the absolute value in the base.

If both numbers are integers, and they are the same, forcing can be done, but excludes elements with the noround option. If both are integers and they differ, no forcing is done.

If either the base or the sum of the absolutes is not an integer, and the values are the same to within one part in 1,000, forcing can be done. As noted above, elements with the noround option are not affected by the rounding process.

(34)

Quantum User’s Guide Volume 2

20 / The hierarchy of the tabulation section – Chapter 2

For further information, see section 7.5, ‘The base for T statistics’ in the Quantum User’s Guide Volume 3.

For further information, see section 7.7, ‘Suppressing percentages and statistics with small bases’.

For further information about column headings and g statements, see chapter 6, ‘Using axes as columns’.

If rounding may be done, Quantum finds the largest absolute and alters the corresponding percentage so that the sum of all percentages is 100%. Quantum chooses the largest absolute because changing the percentage for this figure will cause least distortion to the original percentages. If several elements have the same largest value, Quantum changes the percentage for the first of those elements and leaves the others untouched.

The decisions on whether or not rounding may take place, and which value to round, are based on the values with all the decimal places that Quantum holds for them, not just the values you see printed in the table.

rsort Sort tables row-wise (that is, vertical sorting rather than horizontal row-wise

sorting). This is the default.

side=n This option can be used to alter the row text width. The default is side=24 and the

maximum side text width is 120 characters.

smallbase= Defines the value below which bases are to be marked as small bases in tables with

special T statistics.

smbase= Suppresses percentages, means, standard deviations, standard errors and sample

(error) variances in a cell if the base for the percentage or statistic is less than the given figure. Use with smrow to suppress row percentages or with smcol to suppress all other types of percentage.

smcol Indicates that values defined with smsupa/smsupp/smsupt refer to columns.

When columns are suppressed in an axis whose column headings are defined on g statements, Quantum ignores the g statements and creates its own column headings using the texts defined on the elements themselves.

smflag=n When statistical tests are carried out on cells with small bases, the percentages in

those cells may appear to be significant when they are not. smflag= enables you to determine what constitutes a small base and to flag cells with that base when the table is printed.

(35)

Quantum User’s Guide Volume 2

The hierarchy of the tabulation section – Chapter 2 / 21

For further information about sorting, see section 6.3, ‘Sorting tables’ in the Quantum User’s

Guide Volume 3.

n is an integer or real value which determines the maximum size of a ‘small’ base.

When a table containing row, column and/or total percentages is printed, Quantum will print the letter ‘s’ to the right of any cell in which the unweighted base in the appropriate direction (e.g. column base for column percentages) is smaller than n.

smrow Indicates that values defined with smsupa/smsupp/smsupt refer to rows. This is the

default.

smsupa=n Suppresses any element in which all absolutes are below the given value. Use with

smrow to suppress rows and/or smcol to suppress columns. If all elements in a

table are suppressed, the table itself is suppressed. You can therefore use this option to suppress tables in which the base is less than a value of your choice.

smsupp=n (or smsupc=n). With smrow, suppresses any row in which all column percentages

are below the given value. With smcol, suppresses any columns in which all row percentages are below the given value. If all elements in a table are suppressed, the table itself is suppressed.

smsupt=n Suppresses any element in which all total percentages are below the given value.

Use with smrow to suppress rows and/or smcol to suppress columns. If all elements in a table are suppressed, the table itself is suppressed.

smtot Used with one of the smsup options to suppress rows in which the leftmost base

value is less than the value given with smsup. Without smtot, all values in the row are compared against the smsup value.

sort Creates sorted or ranked tables.

spechar=ab When a cell in a table is zero or would round to zero, you may wish to have

specific characters or blanks printed in the cell in place of the zeros. spechar (short for ‘special characters’) makes this possible. The first character (a) is placed in cells which have true zero values, while values which round to zero are replaced with the second character (b). The special characters may be any non-numeric character or blank. If either character is blank, enclose the pair of characters in double quotes. For example:

spechar=" *"

(36)

Quantum User’s Guide Volume 2

22 / The hierarchy of the tabulation section – Chapter 2

Quantum differentiates between means and other statistics, such as standard deviation, in which the sum of values is zero, and those in which the sum of cases (respondents) is zero. Quantum only prints the special character if the number of cases going into the mean is zero. Thus, 0/3 is always printed as zero, whereas 0/0 will be printed as the special character for zero if one is defined.

Zero values generated as the result of manipulation are always printed as such and are never replaced with a special character.

For further information, see section 7.6, ‘Printing more than one table per page’.

Tables formatted with the postprocessor pstab for printing on a PostScript printer are automatically centered within the page width.

For further information on pstab, see section 9.1, ‘Printing output with pstab’ in the Quantum User’s Guide Volume 3.

For further information, see chapter 7, ‘Special T statistics’ in the Quantum User’s Guide Volume 3.

squeeze= Prints as many pages of the current table as possible on the same page.

tabcent Center tables within the page width.

title Creates left-justified table titles of the form ‘row by column’ from the axis titles

defined with hd= on the row and column l statements. For example, if the axes age and sex are introduced by the statements:

l age;hd=Age of Respondent l sex;hd=Sex of Respondent

the table title will be ‘Age of Respondent by Sex of Respondent’.

topc Prints a percent sign at the top of each column of the table. This option is only valid if you use nopc (don’t print percent signs after percentages) and op=2 (print column percentages) together and op=1, op=3 or op=8 are not present.

tstatdebug Prints the intermediate figures for all special T statistics in a run. You may use this

(37)

Quantum User’s Guide Volume 2

The hierarchy of the tabulation section – Chapter 2 / 23

Using ttbeg=base with baft generates an error message since the two are incompatible. ttbeg=(text,text, ... )

Quantum normally prints titles in the following order: • table number

• higher (3+) dimension texts

texts following column l statementstexts following row l statementstexts following tab statementstexts following flt statementstexts following flt= statements

If you are generally happy with this order but there are one or two titles that you want to print first rather than in their default positions, specify just those titles with

ttbeg=. Quantum will then print those titles first, in the order you list them with ttbeg=, and then all other types of titles in their default order.

Each type of title has its own keyword: tb table number

high higher (3+) dimension texts

top texts following column l statements side texts following row l statements tab texts following tab statements flt texts following flt statements nflt texts following flt= statements

To specify titles, enter the appropriate keywords inside the parentheses in the order you want those titles printed, and separate them with commas.

Titles starting with the word Base are usually positioned according to the type of statement they follow. By using the keyword base with ttbeg= you may determine more specifically where such texts are printed. Therefore, to print texts following

flt statements first, texts following tab statements next, and with all texts starting

with Base underneath you would write: a;ttbeg=(flt,tab,base)

Any other titles would be printed below the base texts in the order tb, high, top,

(38)

Quantum User’s Guide Volume 2

24 / The hierarchy of the tabulation section – Chapter 2 ttend=(text,text, ... )

This is the opposite of ttbeg because it defines those titles which are to be printed at the end of the list of table titles. Keywords are as described for ttbeg=. You would normally use ttend when you are generally happy with the order in which Quantum prints titles, but there is one particular type of title that you always want to print last rather than in its default position.

If baft is also present in the program, it is imputed as ttend=base after all other

ttends, although if base is present on the ttend= an error will occur. ttord=(text,text, ... )

This defines the order in which table titles are to printed. You use it when you want to specify your own order for titles, and to have this order override completely the default order that Quantum normally uses. Conventions are as described for

ttbeg=, except that the top parameter is not valid with ttord.

If your list omits some of the titles that Quantum normally prints, these titles will not be printed. For example, if you type:

ttord=(tb,tab)

your tables will have a table number and any titles defined with tt statements under

tab statements. Titles defined in any other place (under the l statement, for

example) will never be printed.

type Prints the output type (for example, Absolutes, Column Percents) in the top right-hand corner of the table. This is the default, but notype may be used instead to suppress printing.

(39)

Quantum User’s Guide Volume 2

The hierarchy of the tabulation section – Chapter 2 / 25

Data options

Data options are options which determine how the numbers in the tables will be calculated. They have nothing to do with the way those values are subsequently printed.

Unless otherwise stated, all options are valid on a, sectbeg, flt and tab statements.

axcount This keyword requests a summary of the records present in each axis. For each

axis, Quantum reports the axis name, the number of records which were excluded from the axis because they failed the condition on the l statement, the number of blank records (i.e., those with no responses to any of the totalizable elements), and the number of records which had at least one code in a totalizable element. For this group of records, a further breakdown shows the number of records with 1 code, 2 codes, and 3+ codes.

The report is printed at the end of out2, just before the counts of records accepted and rejected. Axes are sorted in alphabetical order, and in levels jobs, within level. For example:

Axis Skipped Blank Coded 1 code 2 codes 3+ codes

ax01 - 4 96 26 38 32

ax02 - 8 92 27 31 34

ax03 - 4 96 22 44 30

ax04 7 - 93 17 49 27

In this example, all records are eligible for inclusion in ax01: 4 are blank and 96 are coded. Of those, 26 are single-coded, 38 have 2 codes and 32 have 3 or more codes. In ax04, 7 records skip this axis because they fail the condition on the l statement. The remaining 93 records are all coded.

axreq= This allows an axis to be used to edit the data and report on whether the record

fulfilled the conditions within the axis. The type of coding required within the axis is defined as follows:

none no requirements (default) sc single-coded

scb single-coded or blank nb not blank

If a record fails the condition on the l statement, then the checks for type of coding are ignored. In all other cases, the checks are made, and any records failing the requirement are written to out2 with an explanatory message, as for require statements in the edit. Lines are also appended to the summary at the end of the print file, out2, and to the summary file, sum_, reporting the number and percentage of records failing each type of condition.

References

Related documents