[toc]
 

In Chapter 4 you learned how to define the parts of a table and how to write a basic specification file to print tables. This chapter goes into more detail about the options in that chapter, including defining variable expressions and controlling the format of what prints on a table. In addition, it covers how to control printing on a row by row or column by column basis, how to run tables against multiple banners, how to assign your own table names, and how to reprint tables stored in a database file.

The specification file ALTTABS.SPX prints an alternate set of tables using the Road Runner sample questionnaire to illustrate several of the options covered in this chapter. See \CFMC\Mentor\ROADRUNR\ALTTABS.SPX (DOS/UNIX) or ALTABSPX.ROADRUNR.CFMC (MPE).

5.1 EXPRESSIONS AND JOINERS

Chapter 4 describes how to define a simple data variable, meaning a variable that defines one data field. This section describes how to write expressions. Expressions allow you to write definitions made up of one or more data variables and might include joiners, mathematical operators, functions, or commands to calculate statistics or build special tables. Refer to Chapter 6 Advanced Tables for special tables and mathematical operators and 9.3.2 Functions for information on functions.

The end of 4.6 DEFINING DATA defines an expression that includes a user-defined total column and joins the categories of two data variables to form the table’s column variable. You will use expressions to build statistical calculations into either of the table’s axes, to base or weight your tables, and to create special tables such as break or overlay tables.

The basic syntax for an expression is:

varname: varname/[variable] joiner varname/[variable]

varname is the name of this expression (optional if defined inside a TABLE_SET structure).

: colon follows immediately to indicate this is an expression.

varname/[variable] can be either the name of a previously defined variable or expression or the variable definition itself inside brackets ([ ]).

joiner is any one of the logical, vector, or mathematical joiners listed below used to join or connect the variables on either side of it.

A: (B WITH C) BY ([5^N1] AND D)

Parentheses are helpful to indicate hierarchy in an expression with changing joiners. Here is a brief summary of each joiner type followed by a more detailed explanation and examples.

LOGICAL JOINERS

AND Both sides of joiner must be true, i.e., responses exist in the data.

OR Either side is true.

NOT Reverses the truth of the statement following it.

VECTOR JOINERS

WITH          Extends the list of categories.

BY            Crosses each category combination (all categories on the left by all categories on the right).

WHEN          Like BY, but only one category is returned from the right side of the joiner.

INTERSECT     If categories on both sides are true, then the combined category is true (acts as an AND NET

operation).

NET           Nets the corresponding categories (acts as an OR NET operation).

OTHERWISE     Uses the first category set if present, otherwise the second category set.

MATH JOINERS

 

Relational:   EQ or = Equal

NE or <> Not equal

LT or < Less than

GT or> Greater than

LE OR <= Less than or equal

GE OR >= Greater than or equal

 

 

Operators: * Multiply

/ Divide

+ Add

– Subtract

% Percentage

++ Add (even if some element is missing)

*=,/=,+=,-=,%= Performs the operation on the item to the left of the equal = sign.

 

5.1.1 Logical Joiners

Logical joiners evaluate an expression by first converting each variable referenced from multi-category to single category, then combining the categories to determine whether the entire expression is true. The categories are not considered separately, rather they are “netted” into a single logical category, the result of a which is always either TRUE or FALSE.

EX: example1: (a OR b) AND NOT(c OR d)

Regardless of how many categories are in A and B, they are treated as one category by the OR joiner.

NOTE: Parentheses are recommended to indicate hierarchy in an expression with changing joiners.

You are most likely to use logical joiners to define a table base, e.g., respondent is female and has children, though it would also be appropriate to use them in a complex banner.

AND Combines two or more expressions into a single logical category and is true if some category of its components are true, but false if any of its components are false.

 

example1: [1/51^1] AND [1/52^5,6]

Age         Income

|             |

1 category    1 category

<35          >$35k

 

Creates one category (respondents under age 35) AND (income >$35,000). The respondent either falls into this age category AND the income category (TRUE) or does not (FALSE).

 

example2: [1/51^1,2/3,4/5,6] AND [1/52^1/2,3/4,5,6]

Age               Income

|                     |

3 categories          3 categories

<35/35-54/>54       <$15k/$15-$35k/>$35k

 

Also creates one category (age is <35 or 35-54 or >54) AND (income is <$15k or $15-$35k or >$35k). The respondent either falls into one of the three age categories AND one of the three income categories (TRUE) or does not (FALSE).

OR Combines expressions into a single logical category and is true if any of its components are true, but false if all of its components are false.

 

example1: [1/51^1] OR [1/52^5,6]

Age        Income

|           |

1 category   1 category

<35         >$35k

 

Creates one category (respondents under age 35) OR (income >$35K). The respondent can either fall into this age category OR the income category to be TRUE, but will only be FALSE if age is greater than 35 (or not specified) AND income is less than $35K (or not specified).

NOT Creates a category with the opposite truth value of the expression stated.

Strictly speaking, NOT is a function rather than a joiner because it is always specified as NOT([variable]) and can be combined with either the OR or AND joiner in an expression. How you place parentheses can affect the meaning of the entire expression. Think of all locations within a NOT statement as having an AND NOT relationship. If you want to have an OR NOT relationship, separate the variables with NOT preceding each one:

example1: NOT([1/51^1,2] OR [1/52^1-3])

This expression defines one category including only those respondents who have neither a 1 nor a 2 punch in record 1 column 51 AND have neither a 1, 2, nor 3 punch in record 1 column 52.

example2: NOT([1/51^1,2]) OR NOT([1/52^1-3])

This expression also defines one category: respondents who have neither a 1 nor a 2 punch in record 1 column 51 OR who have neither a 1, 2, nor 3 punch in record 1 column 52

To define an OR condition within a single data column, each punch position must be defined with its own NOT statement.

example3: NOT([1/51^1]) OR NOT([1/51^2])

You could also write this as example3:[1/51^N1]) OR [1/51^N2] to mean the same thing, record 1 column 51 is not a 1 punch OR a 2 punch.

Although you can use multi-category expressions with a logical joiner, remember that the joiner lumps the categories together into one. The two examples below return the same result.

[1/45^1,2/3,4] OR [1/47^1/2]

[1/45^1-4] OR [1/47^1,2]

5.1.2 Vector Joiners

Vector joiners combine expressions to alter their meaning or form other expressions.

WITH appends the categories from two or more variables to form one expression with all categories, read and printed left to right. This joiner is used most often to generate a complex banner (see 4.11 SAMPLE SPECIFICATION FILES for an example table).

 

example1: [1/51^1,2/3,4/5,6] WITH [1/52^1/2,3/4,5,6]

Age                     Income

|                   |

3 categories             3 categories

<35/35-54/>54   <$15k/$15-$35k/>$35k

 

1st category is punches 1 or 2 from 1/51

2nd category is punches 3 or 4 from 1/51

3rd category is punches 5 or 6 from 1/51

4th category is punch 1 from 1/52

5th category is punches 2 or 3 from 1/52

6th category is punches 4 or 5 or 6 from 1/52
BY creates categories for every combination of its component expressions. It crosses all categories to the left of BY with the first category on the right, then all categories on the left with the second category on the right, and so on until all combinations have been created. This joiner is most often used to generate either a complex banner or stub.

 

example1: [1/51^1,2/3,4/5,6] BY [1/52^1/2,3/4,5,6]

Age                  Income

|                 |

3 categories   3 categories

<35/35-54/>54       <$15k/$15-$35k/>$35k

 

This expression creates nine categories as follows:

 

1st category (<35 and <$15k)

2nd category (35-54 and <$15k)

3rd category (>54 and <$15k)

 

4th category (<35 and $15-35k)

5th category (35-54 and $15-35k)

6th category (>54 and $15-35k)

 

7th category (<35 and >$35k)

8th category (35-54 and >$35k)

9th category (>54 and >$35k)
WHEN acts to combine an expression and a logical expression, i.e., “A WHEN B” means that the categories in A are counted only when B is true.

 

example1: [1/51^1,2/3,4/5,6] WHEN [1/52^6]

Age              Income

|               |

3 categories   1 category

<35/35-54/>54     >$35k

 

This expression produces three categories:

 

1st category counts respondents under age 35 only WHEN income is >$35k

2nd category counts respondents aged 35-54 only WHEN income is >$35k

3rd category counts respondents over age 54 only WHEN income is >$35k

 

NOTE: If the item on the right side of the WHEN is a multi-category item it will be converted into one category returning either TRUE or FALSE.
INTERSECT combines the categories of the multi-category variable on the left and the multi- category variable on the right in an AND operation. If BOTH categories are true then the resulting category is true. The expression must have the same number of categories on each side of the INTERSECT joiner. A practical example might be as follows:

 

[1/10^1//5] INTERSECT [1/11^1//5]

saw advertisement     purchased product

 

where the left side of the expression represents a multi-category question determining whether the respondent saw an advertisement for products and the right side represents another multi-category question determining which products were purchased. The intersection of these two variables combines the categories on both sides of the joiner with an AND operation: to be counted the respondent must have a response in record 1 column 10 AND a response in record 1 column 11.

The example above will return five categories:

1st category 1/10^1 AND 1/11^1
2nd category 1/10^2 AND 1/11^2
3rd category 1/10^3 AND 1/11^3
4th category 1/10^4 AND 1/11^4
5th category 1/10^5 AND 1/11^5
NET combines the categories of the multi-category variable on the left and the multi- category variable on the right in an OR operation. If EITHER category is true, then the resulting category is true. Like INTERSECT, the expression must have the same number of categories on each side of the joiner.

Referring to the previous example, NET would combine the categories on both sides of the joiner in an OR operation: count respondent if he has a response in record 1 column 10 OR has a response in record 1 column 11.

That example would return five categories:

1st category 1/10^1 OR 1/11^1
2nd category 1/10^2 OR 1/11^2
3rd category 1/10^3 OR 1/11^3
4th category 1/10^4 OR 1/11^4
5th category 1/10^5 OR 1/11^5

A more practical example might be netting the categories for aided and unaided awareness questions to create a total awareness category.
OTHERWISE checks for some response in the variable specified to the left of the joiner. If responses exist in any of the categories defined then those are used. If no categories in the variable on the left are true, then the categories defined in the variable to the right of the joiner are used.

OTHERWISE is most often used with single response variables, e.g., if male respondent otherwise female respondent. Use this joiner with caution for multi- response data, i.e., only if one side or the other of the joiner could have data and not both, otherwise only the responses found for the left side of the expression will be used. If both sides could have data you should use NET.

example1: [1/5^1] OTHERWISE [1/5^2]

Means count respondents who have a 1 punch in record 1 column 5, otherwise check for a 2 punch in the same column.
JOIN combines multiple text variables or a text string within a text variable. For example:

M [30.2$] = STRIP([11.3$]) JOIN STRIP([21.3$])

The STRIP function strips leading and trailing blanks from the field.
Excluding Respondents From A Table

This example illustrates using an expression to base your tables. Respondents can be excluded from a table or group of tables by assigning either a filter or base during tabulation. There are three important distinctions to note, however.

First, a filter returns a single category (even if the variable referenced has multiple categories) whereas a base returns the same number of categories as there are in the variable referenced. For example, if your filter references a variable for respondent sex it will return one category regardless of the response in the data. A base referencing the same variable would return two categories, male and female. Using respondent sex as a base would produce two sets of tables, one for the male respondents and one set for the females.

Second, the ~SET option DROP_BASE affects only the variable defined with BASE=, not FILTER=.

Finally, only BASE= generates an automatic TITLE_4 definition from the base variable specified (see related command EDIT= TITLE_4_FOR_BASE).

You can define a filter for a table (e.g., women respondents only) and then use a base (e.g., married with children) to further subset the filtered group.

 

TABLE_SET= { qn1_z:

FILTER=: [1/57^2]

TITLE_2=:Filter is women respondents only \N }

BASE=: [1/54^1] AND [1/55.2#1-10]

TITLE_4=:\NBase is married with children }

TITLE=:

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.}

STUB=:

(5) Completely agree

(4) Somewhat agree

(3) Neither agree nor disagree

(2) Somewhat disagree

(1) Completely disagree

Don’t Know/Refused to answer }

ROW=: [1/6.1^5//1/10]

}

 

FILTER= is the keyword that defines a table filter. In this example, record 1 column 57 must have a 2 punch for the case to be included in this table.

TITLE_2= is the keyword that defines a table title that will print directly above the title defined with TITLE=. \N (new line) will cause a blank line to print after the text.

BASE= is the keyword that defines a table base. In this example, we have defined an expression with the AND joiner to further subset the filter already defined: to be included in this table the case must have a 1 punch in record 1 column 54 AND a number in the range 1-10 in record 1 columns 55 and 56.

TITLE_4= is the keyword that defines a table title that will print directly below the title defined with TITLE=. As explained for TITLE_2, \N will print a blank line before printing the TITLE_4 text.

 

>PURGE_SAME

~INPUT rrunr,MAYBE_BACKUP,DOT=100

>DEFINE @STUDY base

>PRINT_FILE @STUDY~

~SPEC_FILE @STUDY~

 

~DEFINE TABLE_SET={tabtop:

SET AUTOMATIC_TABLES

HEADER=: =Road Runner Fast Food Sample Tables

Prepared on #date# }

FOOTER=: =Tables prepared by Computers for Marketing Corp.

Page #page_number# }

 

EDIT=: -COLUMN_TNA, -ROW_NA, PERCENT_DECIMALS=0,

COLUMN_WIDTH=7, PAGE_WIDTH=95, RUNNING_LINES=2 }

 

BANNER=:

|         <——-AGE——->  <—–INCOME——>  <–RATING–>

|                                                    Neu-

|         Under          Over  Under   $15-   Over  tral/

|  TOTAL     35  35-54     54   $15k   $35k   $35k   Good   Poor

|  —–  —–  —–   —-   —–  —-   —-   —-   —- }

 

COLUMN=: TOTAL WITH &

[1/51^^1,2/3,4/5,6] WITH & ”RESPONDENT AGE

[1/52^^1/2,3/4,5,6] WITH & ”INCOME

[1/47^^4,5/1,2,3]         ”RATING

}

 

TABLE_SET= { qn1_z:

FILTER=: [1/57^2]

TITLE_2=:Filter is women respondents only \N }

BASE=: [1/54^1] AND [1/55.2#1-10]

TITLE_4=:\NBase is married with children }

TITLE=:

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it. }

STUB=:

(5) Completely agree

(4) Somewhat agree

(3) Neither agree nor disagree

(2) Somewhat disagree

(1) Completely disagree

Don’t Know/Refused to answer }

ROW=: [1/6^5//1/10]

}

 

~EXECUTE

MAKE_TABLES

~END

 

 

Road Runner Fast Food Sample Tables

Prepared on 24 AUG 2012

TABLE 001

Filter is women respondents only

Q1. How much do you agree with the following statement: The fast food at Road Runners is worth what I pay for it.

Base is married with children

 

<——-AGE——-> <——INCOME——>  <–RATING–>

Neu-

Under          Over  Under $15-   Over  tral/

TOTAL     35  35-54     54   $15k $35k   $35k   Good   Poor

—–  —–  —–   —-  —– —-   —-  —–   —-

 

Total                  34     11     11      4      3     11     14      8     18

100%   100%   100%   100%   100%   100%   100%   100%   100%

 

(5) Completely agree    8      –      5     –     1   4   1 1 5

24%           45%           33%   36%     7%    13%    28%

 

(4) Somewhat agree 4      3      1     –     –   2      2      2      1

12%    27%     9%                  18%    14%    25%     6%

 

(3) Neither agree 4      2      –     –      1      –      3      1      3

nor disagree           12%    18%                  33%           21%    13%    17%

 

(2) Somewhat            7      2      3      1     –   2      4      3      3

disagree               21%    18%    27%    25%           18%    29%    38%    17%

 

(1) Completely          9      4      2      2      –      3      4      1      5

disagree               26%    36%    18%    50%           27%    29%    13%    28%

 

Don’t Know/Refused      2      –      –      1      1      –      –      –      1

to answer               6%                  25%   33% 6%

 

 

Tables prepared by Computers for Marketing Corp.

Page 1

 

5.1.3 Mathematical Joiners And Operators

This class of joiners and operators is most likely used in data cleaning and data generation procedures. This section provides an overview of each mathematical joiner and operator.

Using relational joiners, expressions can be formed by defining a comparison of variables and/or numbers using: less than (LT or <), less than or equal to (LE or <=), greater than (GT or >), greater than or equal to (GE or >=), equal (EQ or =), and not equal (NE or <>).

Here are some examples for logical comparisons that check for subsets among categorical variables:

var1 > var2

Means that every category in var2 must be in var1 (i.e., var2 is a subset of var1), but var1 may have some category that var2 does not; use LT (<) to reverse the comparison.

var1 = var2

Means that var1 and var2 have exactly the same categories, including none at all.

var1 <> var2

Means each variable has some category that the other does not, but they may have some categories in common.

The operators +, -, /, *, and % are used to define the addition, subtraction, division, multiplication, and percentage of variables and/or constants. The ++ operator also performs addition but treats missing elements as zero, unless all elements are missing:

A ++ B

Means A + B if both are present, A if B is missing, B if A is missing, and missing if both A and B are missing. For vectors (multi-category variables), ++ evaluates on a category by category basis (like NET).

An equal sign (=) after the operator means perform the operation on the element to the left of the equation:

 

A += B returns the result of A + B and puts it in A

A /= B returns the result of A / B and puts it in A

A -= B returns the result of A – B and puts it in A

A *= B returns the result of A * B and puts it in A

A %= B returns the percent A is of B and puts it in A

 

5.2 Axis Commands/Cross-Case Operations

Axis commands are only used in expressions that form either your horizontal or vertical table axis, meaning they operate across all cases in the data set when a table is made. Axis commands are used to calculate statistical computations or make special types of tables. Statistical calculations are included in the sample table run files (see \CFMC\Mentor\ROADRUNR (DOS/UNIX) or ROADRUNR.CFMC (MPE)) provided with your Mentor software. Refer to Chapter 6: Advanced Tables for examples of special types of tables, break and overlay.

Syntax:  AXIS= expression $[keywords] expression $[ ]expression

AXIS is optional. Axis command keywords must be specified inside brackets ([ ]) which are preceded by a dollar sign ($). Separate more than one keyword inside the brackets with either a comma or a space. Output from these keywords will print on the table in the order specified.

This section describes how to include three statistical calculations (mean, standard deviation, and standard error) to the row variable definition and how to add the correct labelling to the stub set for the statistics rows. See Appendix B: TILDE COMMANDS under ~DEFINE AXIS= for a complete list of $[keywords].

$[MEAN] calculates the mean of the variables that follow. Means can be computed on more than one numeric variable by connecting them with the WITH joiner or referencing them within the brackets of a data variable. You can also reverse values or assign categories different values. See 6.2.1 Means on Rating Scales Using the Variable Definition for more details.
$[SE] calculates the standard error of the sample from the mean of the variable(s).
$[STD] calculates the standard deviation of the sample from the mean of the variable(s).

Here is a TABLE_SET definition that includes these three statistical tests. See 4.4 TABLE BUILDING (THE INPUT AND EXECUTE STATEMENTS) for information on TABLE_SET.

 

TABLE_SET= { qn4_z:

TITLE=:

Q4. About how much do you pay per visit for Road Runner fast food – that is, not including entertainment?}

STUB=:

$ 5-$10

$11-$15

$16-$20

$21-$25

$26-$30

$31-$35

$36-$40

$41-$45

$46-$50

Refused

[STAT] Mean

[STAT] Standard deviation

[STAT] Standard error}

ROW=: [1/15.2# 5-10/11-15/16-20/21-25/26-30/31-35/36-40/41-45/46-50/”RF” ] &

$[MEAN,STD,SE] [1/15.2 *RANGES=5-50]

}
ROW=: [1/15.2# 5-10/11-15/16-20/21-25/26-30/31-35/36-40/41-45/46-50/“RF”] defines the data type and its categories for the row variable.
& ampersand continues the definition to the next line.
$[MEAN,STD,SE] says calculate these statistics across all cases for this table. [1/15.2 is the location of data to be used in the statistical calculations.
*RANGES=5-50] specifies which data categories to include (minimum value of 5 through maximum value of 50) in the statistical calculations for this variable. (see 4.6 DEFINING DATA)

Note that the stub label set has three lines at the end for the statistics calculated in the row variable.
[STAT] is referred to as a stub option. The keyword STATISTICS_ROW (abbreviated STAT) is required to identify this as a statistics row. By default no percent sign will print and the number of decimal places of significance is one unless otherwise specified (see EDIT= STATISTICS_DECIMALS= in 5.3 Changing Table Specifications, Print Options).
Meanis the label that will print for this table row.

Here is a sample table generated from this TABLE_SET definition using the same banner and edit controls from the model table run described in 4.11 SAMPLE SPECIFICATION FILES.

 

Road Runner Fast Food Sample Tables

Prepared on 13 AUG 1994

TABLE 001

Q4. About how much do you pay per visit for Road Runner fast food – that is, not including entertainment?

 

<——-AGE——->  <—–INCOME——>  <–RATING–>

Neu-

Under   Over Under $15- Over  tral/

TOTAL     35  35-54     54   $15k   $35k   $35k   Good   Poor

—–  —–  —–   —-  —–   —- —-  —–   —-

Total          500    141    140    143     74    148    215    166    247

100%   100%   100%   100%   100%   100%   100%   100%   100%

 

$5-$10          58     23     21     10     10     14     29     23     26

12%    16%    15%     7%    14%     9%    13%    14%    11%

 

$11-$15         52     15     16     12      6     14     22     15     27

10%    11%    11%     8%     8%     9%    10%     9%    11%

 

$16-$20         55     11     18     17      6     14     26     21     29

11%     8%    13%    12%     8%     9%    12%    13%    12%

 

$21-$25 42     14      9     12      9     14     13     14     19

8%    10%     6%     8%    12%     9%     6%     8%     8%

 

$26-$30         53     16     16     12      5     12     26     11     29

11%    11%    11%     8%     7%     8%    12%     7%    12%

 

$31-$35         47     12      9     17      6     16     18     15     27

9%     9%     6%    12%     8%    11%     8%     9%    11%

 

$36-$40         52     12     15     18     11     14     24     16     23

10%     9%    11%    13%    15%     9%    11%    10%     9%

 

$41-$45         51     15     17     13     10     16     21     19     23

10%    11%    12%     9%    14%    11%    10%    11%     9%

 

$46-$50         45     12     10     18      7     21     11     16     23

9%     9%     7%    13%     9%    14%     5%    10%     9%

 

Refused         45     11      9     14      4     13     25     16     21

9%     8%     6%    10%     5%     9%    12%    10%     9%

 

Mean     27.28  26.10  25.98  29.71  28.39  29.33  25.93  27.11  27.22

 

Standard

deviation    13.27  13.77  13.55  12.91  13.52  13.62  13.00  13.81  13.11

 

Standard

error       0.62   1.21   1.18   1.14   1.62   1.17   0.94   1.13   0.87

 

 

Tables prepared by Computers for Marketing Corp.

 

5.3 CHANGING TABLE SPECIFICATIONS

This section covers how you can control the format of what is printed on your tables either for all tables, or on a row by row or column by column basis. Printing controls allow you to override defaults for what is printed in the table’s cells (e.g., frequency or percent only) and the format of what is printed (e.g., number of decimal places or percent sign), to alter the printed order of the tables rows (ranking), to enhance readability of tables (comments, underlining, and blank lines), to control what summary information is printed, and to control overall format such as page size, column and row widths.

Several of the print options covered in this section are illustrated in the sample table run ALTTABS.SPX in \CFMC\Mentor\ROADRUNR (DOS/UNIX) or ALTABSPX.ROADRUNR.CFMC (MPE).

GLOBAL PRINT OPTIONS

The edit statement defines a format for printing all tables. In a given table run you could have many edit statements to control printing for specific tables or groups of tables (see Appendix B: TILDE COMMANDS, ~EXECUTE LOCAL_EDIT=). Edit statements are defined, like all other table elements, in the ~DEFINE program block with the keyword EDIT= followed by any number of the allowable edit options. You can include edit statements in a TABLE_SET structure as part of an entire table definition (see 4.11 SAMPLE SPECIFICATION FILES).

Syntax: ~DEFINE EDIT={name:options }

EDIT= is the ~DEFINE keyword used to specify table and page formatting controls.

{ left brace marks the beginning of the definition. (OPTIONAL)

name is the name of this definition. (OPTIONAL if defined within a TABLE_SET structure).

: colon immediately follows name.

options are separated by commas or one or more spaces. Options can be continued on as many lines as needed, with no continuation character needed.

} ends the definition.

COLUMN PRINT OPTIONS

The EDIT= option COLUMN_INFO= allows you to specify what is printed on a table on a column by column basis. For example, you could specify a width for all columns or a different width for each column of the table with the COLUMN_INFO sub-option WIDTH=. This section includes a sample table to illustrate this option. See Appendix B: TILDE COMMANDS, ~DEFINE EDIT= COLUMN_INFO= for all column options.

Syntax: EDIT={ edit1: COLUMN_INFO=(a/b/c/d/e/f) }

a is options for first printed column (i.e., System Total)

b is options for second printed column, etc. (i.e., System No Answer).

c is options for third printed column (i.e., first user-defined printed column), etc.

If you suppress the system Total and No Answer columns then the first user-defined column (e.g., TOTAL WITH) becomes the first printed column. See later in this section for more information on specific column options.

ROW PRINT OPTIONS

Control what is printed on a table on a row by row basis with options specified on the ~DEFINE STUB= statement.

 

Syntax:

~DEFINE

STUB={ <name>:

[options] row text or blank

}

 

STUB= is the ~DEFINE keyword used to define the row labels or stub label set.

{ left brace marks the beginning of the definition. (OPTIONAL)

name is the name of this definition. (OPTIONAL if defined within a TABLE_SET structure).

: colon immediately follows name.

[options] are separated by commas, or one or more spaces.

row text or blank is the text that will print on the table for this row.

} ends the definition.

Where applicable, options or keywords are the same whether applied to all tables (EDIT=), a single column (EDIT=COLUMN_INFO=), or a row (STUB= [option]). This section covers only selected options you will use often. Please see Appendix B: TILDE COMMANDS, ~DEFINE EDIT= for a complete list of edit options and ~DEFINE STUB= for stub options.

SAMPLE TABLE PRINTED WITH DEFAULT OPTIONS

In the following table, notice the defaults: System Total row and column System No Answer row and column Column width: 8 spaces Row label width: 20 spaces Frequencies with no decimal places Frequencies with a value of zero print as a dash (-) in the cell Vertical percentaging off the Total row to 1 decimal point Percent sign (%) prints No horizontal percentaging Page length = 60 lines Page width = 132 columns

 

TABLE 001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.

 

Total N/A Male Female

 

Total                 500         –      263       237

100.0%             100.0%    100.0%

 

 

N/A                     –         –        –        –

 

(5) Completely agree    88   –       49   39

17.6%         18.6%    16.5%

 

(4) Somewhat agree 92   –   43   49

18.4%         16.4% 20.7%

 

(3) Neither agree 86   –   48   38

nor disagree       17.2%         18.3%    16.0%

 

(2) Somewhat         73   –   36   37

disagree       14.6%         13.7%    15.6%

 

(1) Completely         86   –   43   43

disagree       17.2%         16.4%    18.1%

 

Don’t Know/Refused 75   –   44   31

to answer       15.0%         16.7%    13.1%

 

PRINT OPTIONS

 

Cell Manipulation Description                       Default

Options:

 

COLUMN_INFO=(options) Specifies column-specific options EDIT= options

such as width, percent decimals,

statistics, etc.

 

-FREQUENCY         Suppress printing frequencies in Print frequency

(1)                    the cells; prints percentages only.

 

FREQUENCY_ONLY   Prints frequency only, with         Print frequency and

(2)                    no percentages.                         vertical percent

 

FREQUENCY_DECIMALS=# Specifies the number of decimal         0 (print whole

(1)                    places to print for frequencies. number frequencies)

# can be 0-7.

 

HORIZONTAL_PERCENT Prints horizontal percents off the Vertical percent

(1)                    System Total column.

 

HORIZONTAL_PERCENT=x Specifies the horizontal percent Total

(1)                    column base; x can be T for Total,

AR for Any Response column, or # to

specify the number of a particular

column.

 

NUMBER_FORMAT=# Prints frequencies in cells with Numbers printed

(1)                    commas and/or a dollar sign.         without commas

# can be 0 for default, 1 for commas,

or dollar sign. or 2 for commas and a

dollar sign.

 

NOTE: This option does not affect [STATISTICS_ROW] unless

specifically specified as a stub option.

 

PERCENT_DECIMALS=# Specifies number of decimal places 1

(1)                    to print for vertical and

horizontal percents. Can be 0-7.

 

-PERCENT_SIGN           Suppresses printing of % sign         Print %

(1)

 

STAR_PERCENT=#         Prints an asterisk (*)in the percent    -1

line of the cell if the value is less

than the value specified here.

 

# can be -1, 0 , or .001-100:

0 do not print asterisk

-1 if PERCENT_DECIMALS=0 then print * when the percent is less

than .5; if PERCENT_DECIMALS=1 then print * when the percent is less

than .05, and if PERCENT_DECIMALS=2 then print * when the percent is

less than .005. (Note: You cannot specify -1.)

 

Note1: A footnote showing the STAR_PERCENT value prints on the last line of the last page (in the

print position as a footer) of any table that has * in a percent cell.

 

Note2: This option is usually used to note numbers that print as if they were 0%, but are actually

slightly above 0%, especially on a percentage-only table or where very few respondents answered in

some category.

 

STATISTICS_DECIMALS=# Number of decimal places to print 1

(1)                    for statistics. # can be 0-7.

 

TFRP                 Total, No Answer, and base rows         Frequency/

print as frequency only; all other      vertical percent

rows print as percents only.

(TFRP=Total frequency, Rows percents)

 

VERTICAL_PERCENT= Specifies the vertical percentage base   Total row

(1)                    for the table. Can be T for system

Total row, AR for the Any Response row,

>=1 for that data row, or (col,row) to

specify a particular cell. Does not suppress frequency.

 

An option is only available on the EDIT= statement unless marked as follows:

 

(1) Means this option is available on EDIT=, EDIT=COLUMN_INFO, and STUB= [option].

(2) Means this option is available on both EDIT= and STUB= [option]

[option] means this option is only available as a STUB [option]

 

 

Summary Information Description                           Default

Manipulation Options:

 

-COLUMN_NA         Suppress printing of No                   Prints

Answer column.

 

-COLUMN_TNA         Suppress printing of both the Total        Prints

and No Answer columns.

 

NUMBER_OF_CASES         Prints the number of cases above the       Does not print

table title.

 

-ROW_NA                 Suppress printing of system No             Prints

Answer row.

 

-ROW_TNA         Suppress printing of both the system       Prints

Total and No Answer rows.

 

 

Division Between

Columns/Rows:         Description                           Default

 

COLUMN_WIDTH=#         Number of spaces to allot for each         8

column of data

 

STUB_WIDTH=#         Number of spaces to allot for stub         20

labels.

 

SKIP_LINES=#         Number of lines to skip between rows.      1

(2)                    SKIP_LINES=0 condenses printing to fit

the maximum number of rows per page.

 

An option is only available on the EDIT= statement unless marked as follows:

 

(1) Means this option is available on EDIT=, EDIT=COLUMN_INFO, and STUB= [option].

(2) Means this option is available on both EDIT= and STUB= [option]

[option] means this option is only available as a STUB [option]

 

 

Page Configuration Description                           Default

Options:

 

 

BOTTOM_MARGIN=#         Specifies a margin of # lines at the   6

bottom of each page.

 

CONTINUED=         Specifies what to print for           TOP

continued pages of a table. Can

be NONE (no indication of continuation),

TOP prints (continued) next to the table

number on the second and subsequent

pages of the table, BOTTOM prints

(continued) on the bottom of the page to

indicate continuation.

 

CONTINUED_LOCATION Specifies where to print “(continued)”   TOP

on tables that span more than one

page. Can be NONE, TOP, TOP_CENTER,

TOP_RIGHT, BOTTOM, BOTTOM_CENTER, or

BOTTOM_RIGHT.

 

CONTINUED_NUMBER Adds a number suffix to the table   NONE

name of tables that span more than

one page. Can be NONE, AFTER_TABLE_NAME,

or AFTER_CONTINUE. See Mentor,

Volume Two, Appendix B, ~DEF EDIT

CONTINUED_NUMBER for examples.

 

DATA_INDENT=#           Specifies the number of spaces to   0

(2)                    indent the data columns.

 

NOTE: Data is right-justified according to the specified COLUMN_WIDTH. This option allows you to

indent the data beyond the normal print position. It is useful to set off data in the table.

Column headings are not affected by the indenting of the data columns.

 

INDENT=                 Indents the entire table, text           None

labelling included. Options are to

CENTER or the number of spaces to indent.

Useful if tables are bound in a binder.

 

[STUB_INDENT=#]         Specifies number of spaces to indent   None

this stub. Useful to set off a row

such as Sigma or Super-Sigma.

You can also use a vertical bar (|) as a

placeholder to print blank spaces before

the start of the text.

 

STUB_WRAP_INDENT=# Number of spaces to indent sub-            0

sequent stub lines when the label

continues to more than one line.

Default is 0 (do not indent), but may

be any number 1+.

 

TOP_MARGIN=#         Number of rows to leave blank at the top   0

of each page.

 

An option is only available on the EDIT= statement unless marked as follows:

 

(1) Means this option is available on EDIT=, EDIT=COLUMN_INFO, and STUB= [option].

(2) Means this option is available on both EDIT= and STUB= [option]

[option] means this option is only available as a STUB [option]

 

 

Row Manipulation

Options:                Description                                Default

 

[COMMENT]               Prints a comment label, with no            none

corresponding row of data. This text

will wrap at STUB_WIDTH=.

 

[\N]                    Kicks a single blank line before           none

printing this row.

 

[\P]                 Kicks to a new page before printing        none

this row.

 

[LONG_COMMENT]         Like [COMMENT] but will print as far       none

across the page as there are characters,

wrapping at the page width.

 

RANK_IF_INDICATED Checks the stub label set for any          No ranking

[RANK_LEVEL=] commands and ranks the

table rows if any are specified.

 

RANK_LEVEL=#         Level to rank all rows or specific   Level 1

(2)                    row. Can be a number 0-9, where 0

means do not rank. Used as a stub

[option] it can also be L for low,

H for high, or some combination of

#L or #H. See also [KEEP_RANK=].

 

[STATISTICS_ROW] Specifies this as a statistics row.   none

See section “5.2 Axis Commands/Cross-Case

Operations” for example specifications

and table.

 

STUB_PREFACE=         Allows you to define your own           Total

summary row label set to be pre-   N/A

pended to all tables; can be stubset

name, TNA, NONE, or ; to turn off a

previous setting.

 

NOTE: This is very useful if you will be changing print options for these summary

rows often in a run. By defining a stub preface you can use any allowable stub

[option] to control these rows. See also STUB_SUFFIX.

 

UNDERLINE         Underlines this row. Default           none

(2)                    character is a dash (-), but allows

a user-specified character with

UNDERLINE=<character>.

 

An option is only available on the EDIT= statement unless marked as follows:

 

(1) Means this option is available on EDIT=, EDIT=COLUMN_INFO, and STUB= [option].

(2) Means this option is available on both EDIT= and STUB= [option]

[option] means this option is only available as a STUB [option]

 

 

Miscellaneous Options: Description                           Default

 

RUNNING_LINES=#         Controls how table text will be printed,   0

i.e., titles, headers, footers. # can be

0 (default) print as written, 1 to wrap lines

according to any PAGE_WIDTH= or INDENT=

setting, and 2 which means print the first

line like RUNNING_LINES=1, then indent the

second and subsequent lines by the length

of the first word in line one and any

blanks immediately following.

 

NOTE: Text positional characters (= center, < left-justify (default), > right-justify)

automatically set RUNNING_LINES to 0 for that item. Table of Contents is not affected

by RUNNING_LINES, titles are printed according to the specified page width, with all

lines indenting according to the default TCON format for titles.

 

 

TCON                 Prints a table of contents of all   No TCON

tables, table number and title.           printed

 

 

An option is only available on the EDIT= statement unless marked as follows:

 

(1) Means this option is available on EDIT=, EDIT=COLUMN_INFO, and STUB= [option].

(2) Means this option is available on both EDIT= and STUB= [option]

[option] means this option is only available as a STUB [option]

 

Sample Tables

Title Print Positions

 

Text specified on HEADER= prints on line one of the table.

TABLE 001

Text specified on TITLE_2= prints on line three.

Text specified on TITLE= prints on line four.

Text specified on TITLE_4= prints on line five.

 

Total     N/A    Male  Female

 

Total               500 –     263     237

100.0%     100.0%  100.0%

 

N/A                     –       –       –       –

 

(5) Completely agree   88 –      49      39

17.6%     18.6%   16.5%

 

(4) Somewhat agree     92 –      43      49

18.4%     16.4%   20.7%

 

(3) Neither agree      86 –      48      38

nor disagree     17.2%     18.3%   16.0%

 

(2) Somewhat       73 –      36      37

disagree     14.6%     13.7%   15.6%

 

(1) Completely       86 –      43      43

disagree     17.2%     16.4%   18.1%

 

Don’t Know/Refused     75 –      44      31

to answer     15.0%     16.7%   13.1%

Text specified on TITLE_5= prints as a footnote on each page.

 

 

Text specified on FOOTER= prints on the last line of each page.
RUNNING_LINES=2 PAGE_WIDTH=60

 

TABLE 001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.

 

Total     N/A    Male  Female

 

Total                     500       –     263     237

100.0%          100.0%  100.0%

 

N/A                       –       –       –       –

 

(5) Completely agree     88       –     49     39

17.6%   18.6%   16.5%

 

(4) Somewhat agree     92       –     43     49

18.4%   16.4%   20.7%

 

(3) Neither agree            86       –     48     38

nor disagree           17.2%           18.3%   16.0%

 

(2) Somewhat     73       –     36     37

disagree           14.6%   13.7%   15.6%

 

(1) Completely     86       –     43     43

disagree           17.2%           16.4%   18.1%

 

Don’t Know/Refused           75       –     44     31

to answer           15.0%   16.7%   13.1%
-PERCENT_SIGN

 

TABLE 001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.

 

Total     N/A    Male  Female

 

Total                     500       –     263     237

100.0           100.0   100.0

 

N/A                       –       –       –       –

 

(5) Completely agree     88       –     49     39

17.6           18.6    16.5

 

(4) Somewhat agree     92       –     43     49

18.4           16.4    20.7

 

(3) Neither agree            86       –     48     38

nor disagree           17.2            18.3    16.0

 

(2) Somewhat     73       –     36     37

disagree           14.6           13.7    15.6

 

(1) Completely     86       –     43     43

disagree           17.2            16.4    18.1

 

Don’t Know/Refused           75       –     44     31

to answer           15.0           16.7    13.1
FREQUENCY_ONLY, FREQUENCY_DECIMALS=2

 

TABLE 001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.

 

Total     N/A    Male  Female

 

Total                 500.00     0 263.00 237.00

 

N/A           0.00     0   0.00   0.00

 

(5) Completely agree 88.00       0   49.00   39.00

 

(4) Somewhat agree       92.00     0 43.00 49.00

 

(3) Neither agree

nor disagree         86.00     0 48.00 38.00

 

(2) Somewhat disagree 73.00     0 36.00 37.00

 

(1) Completely disagree 86.00     0 43.00 43.00

 

Don’t Know/Refused to

answer                 75.00     0 44.00 31.00
-FREQENCY_ONLY (prints percents only), HORIZONTAL_PERCENT, PERCENT_DECIMALS=2, STAR_PERCENT=-1 (default)

 

TABLE 001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.

 

Total     N/A    Male  Female

 

Total                        100.00%   –   52.60%  47.40%

100.00%     100.00% 100.00%

 

N/A                           –   –   –   –

 

(5) Completely agree     100.00%   –   55.68%  44.32%

17.60%       18.63%  16.46%

 

(4) Somewhat agree     100.00%   –   46.74%  53.26%

18.40%       16.35%  20.68%

 

(3) Neither agree     100.00%   –   55.81%  44.19%

nor disagree               17.20%       18.25%  16.03%

 

(2) Somewhat             100.00%   –   49.32%  50.68%

disagree               14.60%       13.69%  15.61%

 

(1) Completely             100.00%   –   50.00%  50.00%

disagree               17.20%       16.35%  18.14%

 

Don’t Know/Refused     100.00%   –   58.67%  41.33%

to answer               15.00%       16.73%  13.08%

 

NOTE: Percentage less than 0.005 printed as *.
SKIP_LINES=0

 

TABLE 001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.

 

Total     N/A    Male  Female

 

Total                     500       –     263     237

100.0%          100.0%  100.0%

N/A                       –       –       –       –

(5) Completely agree     88       –     49     39

17.6%   18.6%   16.5%

(4) Somewhat agree     92       –     43     49

18.4%   16.4%   20.7%

(3) Neither agree            86       –     48     38

nor disagree           17.2%           18.3%   16.0%

(2) Somewhat     73       –     36     37

disagree           14.6%   13.7%   15.6%

(1) Completely     86       –     43     43

disagree           17.2%           16.4%   18.1%

Don’t Know/Refused           75       –     44     31

to answer           15.0%   16.7%   13.1%
COLUMN_INFO= Controlling Column Widths

This example overrides the default column width of eight spaces for columns two, four, five, six, and seven to create a more even-appearing spacing between some of the banner points, and an obvious spacing between the different groupings (TOTAL, SEX, and AGE). Only the columns named on the COLUMN_INFO option are affected. For a discussion on the banner used in this example refer to 4.8 FORMATTING BANNER TEXT.

EDIT={edit1:COLUMN_INFO=(column=2 width=10/column=4 width=10/column=5 width=7/column=6 width=7/column=7 width=9) }

 

TABLE 001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.

 

 

<—-SEX—>   <—–=——AGE———–>

Don’t

Under          Over    know/

Total      Male  Female        35  35-54     54  Refused

—–      —-  ——     —–  —–   —-  ——-

Total                 500   263     237       141    140   143     76

100.0%    100.0%  100.0%    100.0% 100.0% 100.0%   100.0%

 

(5) Completely agree   88        49     39       21     29     23     15

17.6%   18.6%   16.5%     14.9%  20.7%  16.1%   19.7%

 

(4) Somewhat agree   92     43     49       26     27     27     12

18.4%   16.4%   20.7%     18.4%  19.3%  18.9%   15.8%

 

(3) Neither agree   86     48     38       23     26     24     13

nor disagree         17.2%   18.3%   16.0%     16.3%  18.6%  16.8%     17.1%

 

(2) Somewhat           73      36     37       13     23     21       16

disagree         14.6%   13.7%   15.6%     9.2%  16.4%  14.7%    21.1%

 

(1) Completely           86     43     43       29     17     26     14

disagree         17.2%   16.4%   18.1%     20.6%  12.1%  18.2%   18.4%

 

Don’t Know/Refused   75     44     31       29     18     22       6

to answer         15.0%   16.7%   13.1%     20.6%  12.9%  15.4%     7.9%
Ranking Data Rows: EDIT= RANK_IF_INDICATED and STUB= [RANK_LEVEL=]

Here is an example stub definition indicating that the last four rows should be ranked low, i.e., below the other rows which are ranked at the default level of 1.

This table continues to a second page. By default, (continued) prints at the top of the continued page.

 

TABLE_SET= { qn8_z:

TITLE=:

Q8. From your own experience and knowledge, what do you especially like

about Road Runner?}

STUB=:

Good service/prompt service

Dependable/continuous service

The courteous employees they have/helpful

I like the food/good food

Food selection Good prices Computerized/accurate billing

Helpful in explaining billing questions

Good entertainment Variety of entertainment Nice family atmosphere

Established place/has been around for awhile

Accessible/Available/They’re everywhere Like everything/good place

[RANK_LEVEL=L] Other

[RANK_LEVEL=L] No problem/No complaints

[RANK_LEVEL=L] Don’t know/No answer

[RANK_LEVEL=L] Nothing}

ROW=: [1/40.2^1//15/22//24]

}

 

Here is the EDIT statement for this example table. Note other EDIT= options used.

EDIT=: -COLUMN_NA, -ROW_NA, PERCENT_DECIMALS=0, COLUMN_WIDTH=7, STUB_WIDTH=35, RUNNING_LINES=1,

RANK_IF_INDICATED }

 

TABLE 001

Q8. From your own experience and knowledge, what do you especially like about Road Runner?

 

 

Total   Male Female

 

Total                               500    263    237

100%   100%   100%

 

Like everything/good place         53     26     27

11%    10%    11%

 

I like the food/good food         48     25     23

10%    10%    10%

 

Computerized/accurate billing           47     21     26

9%     8%    11%

 

Helpful in explaining billing questions 46     23     23

9%     9%    10%

 

Established place/has been around for 46     28     18

awhile                                 9%    11%     8%

 

Variety of entertainment         43     25     18

9%    10%     8%

 

The courteous employees they have/ 42     21     21

helpful                                 8% 8%     9%

 

Food selection                         40     20     20

8%     8%     8%

 

Good prices                         40     25     15

8%    10%     6%

 

Nice family atmosphere                 35     21     14

7%     8%     6%

 

Good entertainment                 34     17     17

7%     6%     7%

 

Accessible/Available/They’re            32     11     21

everywhere                         6%     4%     9%

 

Dependable/continuous service         31     12     19

6%     5%     8%

 

Good service/prompt service         28     11     17

6%     4%     7%

 

Other                                 44     29     15

9%    11%     6%

 

No problem/No complaints         21     12      9

4%     5%     4%

 

Don’t know/No answer                 19      7     12

4%     3%     5%

 

 

TABLE 001 (continued)

Q8. From your own experience and knowledge, what do you especially like about

Road Runner?

 

 

 

Total    Male  Female

 

 

Nothing                                 23      15       8

5%      6%      3%
HORIZONTAL_PERCENT= Changing the Percent Base

User-Defined Total In The Banner

In this example the percent base has been changed from the default (system Total row/VERTICAL_PERCENT=T) to the user-defined Total column. The default horizontal percent base is the system Total column. Since that is suppressed on the EDIT statement with -COLUMN_TNA we have specified the user-defined Total column (column 1) as the percent base (HORIZONTAL_PERCENT=1).

Edit statement for this table:

EDIT={ edit1: -COLUMN_TNA, -ROW_NA, PERCENT_DECIMALS=0,HORIZONTAL_PERCENT=1,

-VERTICAL_PERCENT,

COLUMN_WIDTH=7, STUB_WIDTH=30, RUNNING_LINES=2, PAGE_WIDTH=106}

 

TABLE 001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.

 

 

<——-AGE——->  <—–INCOME——>

 

Under       Over  Under   $15-   Over

TOTAL   35  35-54 54   $15k   $35k   $35k

—–  —–  —–   —-  —–   —-   —-

 

Total

 

(5) Completely agree             88     21     29     23     10     30     36

100%    24%    33%    26%    11%    34%    41%

 

(4) Somewhat agree             92   26   27 27 14     30     35

100%   28%   29% 29% 15%    33%    38%

 

(3) Neither agree nor disagree     86   23   26 24 13     22     45

100%   27%   30% 28% 15%    26%    52%

 

(2) Somewhat disagree               73   13   23 21 13     21     33

100%   18%   32% 29% 18%    29%    45%

 

(1) Completely disagree             86   29   17 26 8     27     37

100%   34%   20% 30% 9%    31%    43%

 

Don’t Know/Refused to answer     75   29   18 22 16     18     29

100%   39%   24% 29% 21%    24%    39%
CHANGING PERCENT BASE WITHIN A STUB

In this example VERTICAL_PERCENT is used as a STUB [option] to change the percent base for a row expression, respondent age by sex, where we want to show what percentage each age category is of each sex category rather than of the total sample. This table also illustrates several other options described above: EDIT= STUB_PREFACE, -COLUMN_TNA, PERCENT_DECIMALS=, and STUB options: [UNDER_LINE], [LONG_COMMENT], [SUPPRESS], [SKIP_LINES=], and [STUB_INDENT=].

 

>PURGE_SAME

~INPUT RRUNR

>DEFINE @study vper

>PRINT_FILE @study~

~SPEC_FILE @study~

 

~DEFINE

STUB={ stubtop:  ”Defines the stub for the total and no answer rows.

[SUPPRESS] TOTAL ”The stub option [SUPPRESS] prevents these rows from

[SUPPRESS] no answer} ”printing (same as EDIT= -ROW_TNA).

 

TABLE_SET={ tab1:

SET AUTOMATIC_TABLES

EDIT=: -COLUMN_TNA, STUB_PREFACE=stubtop, PERCENT_DECIMALS=0 }

TITLE=: Respondent sex BY age with changing percent base}

STUB=:

[LONG_COMMENT] Percent base is the total row (suppressed)

[UNDER_LINE, VERTICAL_PERCENT=T] Male

[LONG_COMMENT] Percent base changed to first printed row: Male

[VERTICAL_PERCENT=1]| Under 25

|  25 to 34                           ”| vertical bar acts as a placeholder on stub text

[STUB_INDENT=2] 35 to 44              ”[STUB_INDENT=2] does the same thing as | here,

|  45 to 54                       ”but also indents subsequent lines.

|  55 to 64

|  65 or over

[SKIP_LINES=3, LONG_COMMENT] Percent base changed back to total row

[UNDER_LINE, VERTICAL_PERCENT=T] Female

[LONG_COMMENT] Percent base changed to eighth printed row: Female

[VERTICAL_PERCENT=8]|  Under 25

|  25 to 34

|  35 to 44

|  45 to 54

|  55 to 64

|  65 or over}

ROW=:[1/51^1-6/1//6] BY [1/57^1/2]     ”1-6 nets age categories for all males

}                               ”and all females, then breaks out

”each category by male and female 1//6

~EXECUTE

COLUMN=TOTAL ”defines a total column and banner text ”see note 1 below

MAKE_TABLES

~END

 

Note1. TOTAL is a System Constant. It says use the System TOTAL as the column variable and print

“TOTAL” as the banner label. See “9.3.1 System Constants”.

 

 

TABLE 001

Respondent sex BY age with changing percent base

 

 

TOTAL

Percent base is the total row (suppressed)

Male             229

—-               46%

 

Percent base changed to first printed row: Male

 

Under 25     41

18%

 

25 to 34     42

18%

 

35 to 44     38

17%

 

45 to 54     30

13%

 

55 to 64     48

21%

 

65 or over     30

13%

 

Percent base changed back to total row

 

Female             195

——             39%

 

Percent base changed to eighth printed row: Female

 

Under 25     24

12%

 

25 to 34     34

17%

 

35 to 44     33

17%

 

45 to 54     39

20%

 

55 to 64     32

16%

 

65 or over     33

17%

 

5.4 Printing Multiple Banners For Each Table Row

There may be occasions when you want to print the same row variable and stub label set against more than one column variable and banner label set, while maintaining the order of the table names. SET COLUMN_REPEAT is the command that causes Mentor to print multiple banners consecutively for each row in a table run.

Note: Refer to SET COLUMN_REPEAT_OVERRIDE to override program defaults.

Syntax: SET COLUMN_REPEAT=#

# indicates the number of column variables each row variable will be cross-tabulated by. There is no practical maximum value for #.

When Mentor processes tables in COLUMN_REPEAT mode it assigns table names leaving room for the number of column variables specified. The program builds all tables defined for the first COLUMN= variable specified, then reprocesses the table definitions for the next column variable, and so on until the number of column variables specified on the COLUMN_REPEAT has been satisfied. Tables are then printed in ascending table name order showing the same stub label set against however many banners were specified.

 

>PURGE_SAME

~INPUT rrunr,MAYBE_BACKUP,DOT=100

>DEFINE @STUDY colrep

>PRINT_FILE @STUDY~

~SPEC_FILE @STUDY~

 

~DEFINE TABLE_SET={tabtop:

SET AUTOMATIC_TABLES, COLUMN_REPEAT=2, DROP_LOCAL_EDIT

 

HEADER=: =Road Runner Fast Food Sample Tables

Prepared on #date# }

FOOTER=: =Tables prepared by Computers for Marketing Corp.

Page #page_number# }

 

EDIT=: -COLUMN_TNA, -ROW_NA, PERCENT_DECIMALS=0, STATISTICS_DECIMALS=2,

VERTICAL_PERCENT=T, COLUMN_WIDTH=7, STUB_WIDTH=40, RUNNING_LINES=1,TCON }

}

 

TABLE_SET={banner1:

BANNER=:

|   <——-AGE——->  <—–INCOME——>  <–RATING–>

|                                             Neu-

|         Under          Over  Under   $15-   Over  tral/

|  Total     35  35-54     54 $15k   $35k   $35k   Good   Poor

|  —–  —– —– —- —–  —-   —-  —–   —- }

 

COLUMN=: TOTAL WITH &

[1/51^1,2/3,4/5,6] WITH & ”AGE

[1/52^1/2,3/4,5,6] WITH & ”INCOME

[1/47^4,5/1,2,3]         ”RATING

}

 

&@STUDY~^DEF           ”reads in a file containing TABLE_SET definitions (title,

”stub, row) for each table.

 

TABLE_SET={banner2:

LOCAL_EDIT=: -COLUMN_WIDTH}    ”resets column width to default. Other options

”remain in effect.

BANNER=:

|   <—————STATUS—————->    <–RATING–>

|

|                   Living     Neu-

|               Di-     Wi-             to-     tral/

|   Total Married  vorced   dowed  Single  gether    Good    Poor

|   —– ——-  ——   —–  ——  ——    —-    —- }

 

COLUMN=: TOTAL WITH &

[1/54^1//5] WITH &         ”MARITAL STATUS, Refused category excluded

[1/47^4,5/1,2,3]   ”RATING

}

 

~EXECUTE MAKE_TABLES

~END

 

5.5 TABLE NAMES

Mentor automatically assigns table names starting with T001, though the T by default does not appear as part of the table name on the printed table. T001 represents the variable name for a particular table and is the name this table is stored under in a DB file for future retrieval in table manipulation (9.2 TABLE MANIPULATION) or to load and print a table stored in a DB file (see 5.6 Reprinting Tables). Table names follow the same rules for other variable names. They can be from 1 to 14 alphanumeric characters in length, must begin with an alpha character, and can include . (period), and _ (underscore).

  • There are several options available to you regarding table names:
  • Print the leading alpha character as part of the table name.
  • Specify the starting table name for automatic table naming.
  • Append up to a 16 character prefix or suffix to each table name.
  • Change the default text ‘TABLE ‘ preceding each table name.
  • Specify a unique name for each table.
  • Print a table name different fromthe name stored in the DB file (see 5.6 Reprinting Tables).

PRINTING LEADING ALPHA CHARACTER

EDIT= PRINT_ALPHA_TABLE_NAMES prints the leading alpha character on every table name.

EDIT={edit1: PRINT_ALPHA_TABLE_NAMES }

NOTE: For this and subsequent tables, we are printing the titling only, not the entire table.

 

TABLE T001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.
SPECIFY STARTING NAME

The ~SET TABLE_NAME=name option allows you to specify what the initial table name will be for automatic table naming by Mentor (i.e, SET AUTOMATIC_TABLES, ~EXECUTE STORE=* or TABLE=*). The program will generate table names from this initial name either by incrementing the last number (T001, T002, T003,…), or by alpha-kicking the last letter (T10A, T10B, T10C,…). The leading alpha character of the table name will not print on the tables unless otherwise specified on the EDIT statement as in the example above. This SET command can be used inside the ~DEFINE TABLE_SET= structure.

~SET TABLE_NAME=T0001

 

TABLE 0001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.
PRINTING NAME WITH PREFIX OR SUFFIX

The SUFFIX= and PREFIX= EDIT options allow you to prepend (prefix) or append (suffix) up to 16 characters of text, including blanks and special characters, to the table name (either default or user-specified). Double quotes are required when the text includes blanks or special characters, or when other EDIT options are specified on the same line. PREFIX=; or SUFFIX=; will reset the option to null.

EDIT={edit1: SUFFIX=”_Road_Runner” }

 

TABLE 0001_Road_Runner

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.
REPLACING “TABLE”

The default text ‘TABLE ‘ precedes every table name printed before the title for each table. Use the CALL_TABLE option either to suppress this text entirely or to specify your own. Maximum length is 16 characters including blanks and special characters. CALL_TABLE=; will reset this option to the default ‘TABLE’. EDIT= CALL_TABLE=” ” will suppress the printing of ‘TABLE ‘ before the table name.

EDIT={edit1: CALL_TABLE=”REPORT ” }

This will replace TABLE with REPORT before each table name. Include at least one blank space after the text; if not, the table name will print immediately after this text.

 

REPORT 0001_Road_Runner

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.
SPECIFYING UNIQUE TABLE NAMES

In 4.11 SAMPLE SPECIFICATION FILES, table production was triggered automatically by specifying ~SET AUTOMATIC_TABLES. In this mode it is the ROW= keyword that causes Mentor to make a table from the elements defined and to assign it the next available table name (either from the default table name starting at T001 or from the user-specified beginning table name on the ~SET TABLE_NAME= command).

The ~EXECUTE keyword STORE_TABLES= also causes Mentor to process table specifications. Table names are generated from the name specified on the STORE_TABLES= command (e.g., STORE_TABLES=T001) or STORE_TABLES=* to assign the next available name (either default or user- specified on the ~SET TABLE_NAME command).

In 4.3 DEFINING TABLE ELEMENTS, we discussed the general form of the TABLE_SET structure to define tables. Any table building ~EXECUTE command can be specified in this structure. STORE_TABLES= specified in the TABLE_SET structure allows you to do two things:

  • specify a unique name for each table, overriding the default pattern of automatic table name generation by the program (see STORE_TABLES=*).
  • store the table name as part of the TABLE_SET definition in a DB file, associating that set of table elements with this table name.

 

~DEFINE

TABLE_SET={ qn1_z:

TITLE=:

Q1. How much do you agree with the following statement:

The food at Road Runners is worth what I pay for it.}

STUB=:

(5) Completely agree

(4) Somewhat agree

(3) Neither agree nor disagree

(2) Somewhat disagree

(1) Completely disagree

Don’t Know/Refused to answer }

ROW=: [1/6^5//1/10]

STORE_TABLES=RRUNR_QN1

}

 

Since STORE_TABLES= causes Mentor to process table specifications defined to that point, specify it last in the TABLE_SET definition. Table elements defined after STORE_TABLE= would not be included in that table.

If you make tables using SET AUTOMATIC_TABLES remember that the ROW= keyword causes Mentor to make tables in this mode. Referring to the example above, this TABLE_SET would generate two tables: T001 when ROW= is processed (assuming that this is the first table made) and RRUNR_QN1 with the same elements when the STORE_TABLES= command is processed. SET – AUTOMATIC_TABLES would produce one table.

 

TABLE_SET= { qn1_z:

TITLE=:

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.}

STUB=:

(5) Completely agree

(4) Somewhat agree

(3) Neither agree nor disagree

(2) Somewhat disagree

(1) Completely disagree

Don’t Know/Refused to answer }

ROW=: [1/6.1^5/4/3/2/1/10]

BASE=: [1/57^2]

TITLE_4: Base is women respondents only

STORE_TABLES= T001_a

}

 

In this example SET AUTOMATIC_TABLES mode would cause Mentor to make a table with the title, stub, and row defined above when the ROW= variable is processed (with the next available table name). STORE_TABLES=T001_a would then cause Mentor to make a based version of the same table with the name T001_a.
PRINTING DIFFERENT TABLE NAMES

You can assign table names to be printed that are different from the actual table names stored in the DB file with the option PRINT_TABLE_NAME. The same rules apply as with regular table names: the name must begin with an alpha character; it must be between 1 and 14 characters long; and, if the first alpha character is followed by a number, the alpha character will be stripped.

Like regular table names, Mentor will automatically increment numbers or alpha characters on sequential tables. You can use either ~SET or ~DEFINE EDIT PRINT_TABLE_NAME.

EX: ~SET PRINT_TABLE_NAME=t1

This will print table names Table1, Table 2, etc. See Mentor, Appendix B, ~DEFINE EDIT PRINT_TABLE_NAME for more details and examples.

5.6 Reprinting Tables

If you have stored your finished tables in a DB file then they are available for reprinting (see 4.11 SAMPLE SPECIFICATION FILES). This is especially useful if you have a very large sample and need to make changes to the finished tables that do not require reprocessing the data file. Such changes might be corrections to any table text element, i.e., header, footer, banner text, stub labels, etc., different print options such as percentaging or number of decimal places, or adding printer statistics rows (meaning statistics computed on the existing numbers stored for a table’s cells).

You will need the following files to reprint existing tables: the DB file that the tables are stored in and the LPR file generated automatically by Mentor when ~SPEC_FILES is specified in a table run.

Each table is stored as an entry in the DB file under the table name, e.g., T001 would be the DB entry name for table 001. T001 stores the matrix (the numbers that make up this table) and the variable names for each of its table elements (banner and stub labels, titling, and EDIT statement). Each table element is stored as a separate entry in the DB file. Mentor reprints a table by searching through the open DB files for the actual entry that stores each of the table element variables. Up to five DB files can be open at any one time so it is not necessary to have all the parts of the table stored in the same DB file, i.e., the table definitions could be in one DB file and the actual tables in another. Mentor prints an error message if a table element cannot be located in the open DB files.

The LPR file contains a table printing statement for each table made in the original run. Edit this file to reprint only the tables wanted by deleting lines.

EX: LOAD=T001 PRINT

This statement loads (into system memory) all of the variables needed to print the table named, and then prints the table.

LOAD_TABLES= (abbreviated to LOAD=) is the ~EXECUTE keyword that loads the table specified and its elements from the open DB file into system memory. T001 is the name of the table to be loaded.

PRINT_TABLES (abbreviated to PRINT) is the ~EXECUTE keyword that prints the table currently held in memory.

Here are sample specifications that reprint tables from the Road Runner example set changing the header and adding horizontal percentaging. Note that the data file is not reopened (~INPUT name); it is not needed to reprint existing tables.

 

>PURGE_SAME

>USE_DB rrunr1

>PRINT_FILE retabs

 

~DEFINE

TABLE_SET={ tabtop2=tabtop:

LOCAL_EDIT=: HORIZONTAL_PERCENT}

HEADER=:=THIS IS THE NEW TABLE HEADING }

}

 

~EXECUTE

TABLE_SET=tabtop2

&rrunr^LPR

~END

 

Here is an explanation of the commands from the previous spec file:

ACCESSING THE DB FILE

>USE_DB rrunr1 opens the DB file where the tables were stored from the original run (see 4.11 SAMPLE SPECIFICATION FILES). Up to five DB files can be opened at one time (using USE_DB and CREATE_DB commands). This DB file is opened with Read_only access (the default), so changes in this run will not be saved anywhere.

DEFINING A NEW EDIT STATEMENT AND TABLE HEADER

~DEFINE TABLE_SET={ tabtop2=tabtop: LOCAL_EDIT=: HORIZONTAL_PERCENT} HEADER=:=THIS IS THE NEW TABLE HEADING } }

tabtop2=tabtop tells Mentor that TABTOP2 is the same as TABTOP (see 4.11 SAMPLE SPECIFICATION FILES) except for the elements replaced. (see 4.4 TABLE BUILDING (The INPUT and EXECUTE statements) for more on TABLE_SET).

LOCAL_EDIT= is the ~EXECUTE keyword that appends to a previous edit statement, i.e., the options specified on the edit statement defined for TABTOP remain in effect.

HORIZONTAL_PERCENT will add horizontal percentaging (based by default on the Total column) to the reprinted tables.

HEADER= replaces the HEADER= variable defined in TABTOP with the text specified here.
REPRINTING THE TABLES

~EXECUTE

TABLE_SET=tabtop_e is the keyword to execute the new TABLE_SET definition.

&rrunr^LPR reads in the LPR file (generated when TABS.SPX was run, see 4.11 SAMPLE SPECIFICATION FILES), edited for the tables we want to reprint.

 

THIS IS THE NEW TABLE HEADING

TABLE 001

 

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.

 

<——-AGE——->  <—–INCOME——>

 

Under     Over  Under   $15-   Over

TOTAL     35  35-54     54   $15k   $35k   $35k

—–  —–  —–   —-  —– —–   —-

 

Total                   500    141    140    143     74    148    215

100%    28%    28%    29%    15%    30%    43%

100%   100%   100%   100%   100%   100%   100%

 

(5) Completely agree 88 21     29     23     10     30     36

100%    24%    33%    26%    11%    34%    41%

18%    15%    21%    16%    14%    20%    17%

 

(4) Somewhat agree 92     26     27     27     14     30     35

100%    28%    29%    29%    15%    33%    38%

18% 18%    19%    19%    19%    20%    16%

 

(3) Neither agree        86     23     26     24     13     22     45

nor disagree         100%    27%    30%    28%    15%    26%    52%

17%    16%    19%    17%    18%    15%    21%

 

(2) Somewhat disagree 73     13     23     21     13     21     33

100%    18%    32%    29%    18%    29%    45%

15%     9%    16%    15%    18%    14%    15%

 

(1) Completely disagree 86     29     17     26      8     27     37

100%    34%    20%    30%     9%    31%    43%

17%    21%    12%    18%    11%    18%    17%

 

Don’t Know/Refused       75     29     18     22     16     18     29

to answer         100%    39%    24%    29%    21%    24%    39%

15%    21%    13%    15%    22%    12%    13%

 

Tables prepared by Computers for Marketing Corp.

Page 1

 

NOTE: The last two banner points were omitted from this table due to page size limitations.

ADDING STATISTICS ROWS TO FINISHED TABLES

In 5.2 Axis Commands/Cross-Case Operations, you saw how to compute statistical calculations on the data by defining axis commands, e.g., $[MEAN], as part of the row variable. The statistics are calculated from the data as the table is built. Printer statistics rows can be computed when the table is printed, but they will be calculated off of the existing frequencies in the cells for that table and not the data itself.

 

>PURGE_SAME

>USE_DB rrunr1

>PRINT_FILE retabs2

 

~DEFINE

TABLE_SET={ tabtop_s=tabtop:

LOCAL_EDIT=: COLUMN_MEAN,COLUMN_STATISTICS_VALUES=VALUES(5,4,3,2,1,,),

COLUMN_STD, COLUMN_SE }

}

 

~EXECUTE

TABLE_SET= tabtop_s

&rrunr^LPR

~END

 

Explanation:

 

~DEFINE

TABLE_SET={ tabtop_s=tabtop:

LOCAL_EDIT=: COLUMN_MEAN, COLUMN_STATISTICS_VALUES=VALUES(5,4,3,2,1,,),

COLUMN_STD, COLUMN_SE }

}

 

As explained in the previous example, only the elements defined in the new TABLE_SET, TABTOP_S, will replace or append to the elements already defined for the old TABLE_SET, TABTOP.

This LOCAL_EDIT defines additional EDIT options that will calculate statistics using the existing numbers in the tables. Corresponding row labels are generated automatically.

COLUMN_MEAN calculates a printer mean and must be specified before COLUMN_STD.

COLUMN_STATISTICS_VALUES=VALUES(5,4,3,2,1,,) assigns numeric values corresponding to the data categories for the row variable. These values are used to compute the mean. Comma delimiters indicate categories that will be excluded from any calculation. This has the same affect as the variable modifier *RANGES=1-5, used to exclude categories from statistical calculations in a data variable definition (see the example in 5.2 Axis Commands/Cross-Case Operations). In this example the last two commas exclude the Don’t Know/Refused to answer category in the row variable (ROW=: [1/6^5//1/10]).

COLUMN_STD COLUMN_SE calculates a printer standard deviation and standard error using the values specified for COLUMN_STATISTICS_VALUES.

 

Road Runner Fast Food Sample Tables

Prepared on 12 AUG 2012

 

TABLE 001

Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.

 

<——-AGE——->  <—–INCOME——>

 

Under     Over  Under   $15-   Over

TOTAL     35  35-54     54   $15k   $35k   $35k

—–  —–  —–   —-  —– —–   —-

 

Total                   500    141    140    143     74    148    215

100%    28%    28%    29%    15%    30%    43%

100%   100%   100%   100%   100%   100%   100%

 

(5) Completely agree 88 21     29     23     10     30     36

100%    24%    33%    26%    11%    34%    41%

18%    15%    21%    16%    14%    20%    17%

 

(4) Somewhat agree 92     26     27     27     14     30     35

100%    28%    29%    29%    15%    33%    38%

18% 18%    19%    19%    19%    20%    16%

 

(3) Neither agree        86     23     26     24     13     22     45

nor disagree         100%    27%    30%    28%    15%    26%    52%

17%    16%    19%    17%    18%    15%    21%

 

(2) Somewhat disagree 73     13     23     21     13     21     33

100%    18%    32%    29%    18%    29%    45%

15%     9%    16%    15%    18%    14%    15%

 

(1) Completely disagree 86     29     17     26      8     27     37

100%    34%    20%    30%     9%    31%    43%

17%    21%    12%    18%    11%    18%    17%

 

Don’t Know/Refused       75     29     18     22     16     18     29

to answer         100%    39%    24%    29%    21%    24%    39%

15%    21%    13%    15%    22%    12%    13%

 

Mean               3.05   2.97   3.23   3.00   3.09   3.12   3.00

 

Standard deviation     1.42   1.47   1.37   1.43   1.32   1.47   1.40

 

Standard error       0.07   0.14   0.12   0.13   0.17   0.13   0.10

 

Tables prepared by Computers for Marketing Corp.

Page 1

 

NOTE: The last two banner points were omitted from this table due to page size limitations.