Distribution tables

<< Click to Display Table of Contents >>

Navigation:  Reference > Commands >

Distribution tables

The form of the T command for a distribution table is:

[+] T table [(F= ...)] [(ID='text')] = [stub] * [banner] [+weight],

The T command increments a table for each record for which it is executed. Incrementation is carried out for every cell in the table for which the corresponding cell in the logical matrix "stub by banner" is true.

The stub and banner variables (if present) must both be mvars or svars on the first definition. For all but the first definition an iconstant can be used in place of the stub or banner. In this case only the numbered row or column is incremented for this definition.

A second or subsequent definition of the same table adds more data into the same table matrix.

Every table contains a total row and a total column referred to as row 0 and column 0 respectively. These totals are incremented automatically unless inhibited by use of formats NITR (No Increment Total Row) and NITC (No Increment Total Column).

If stub or banner is absent, the table has only a total row or column unless the stub or banner have been selected using a SELECT command.

The text may be up to 20 characters long and replaces the table name on the printed table output.

The incremental factor is determined by the variables selected for WR and WQ by the SELECT command. If a weight appears on the T command, then this weight overrides the setting of WQ.

For every table for which WR is selected (on the first definition) to be other than 1, two tables are generated, one weighted and one unweighted.

If F=NITB (No Increment Table) then the table is not incremented, this is called a "dummy" definition.

Two degrees of precision for incrementation are available. Format DBL (Double precision) specifies that tables are to be incremented in double precision mode. If F=NDBL the mode is single precision. Single precision tables take up half the space of double precision tables, and take less time to increment. However, they are accurate up to 7 significant digits, whereas double precision tables are accurate up to 13 significant digits. If you require precision beyond 7 figures (for example, if the weighted total for a table is over one million) you should set F=DBL.

The presence of the "+" before T indicates that this is a suppress reading table (same as F=CON) and that it is to be printed immediately below the previous one with no titles or banner labels. In this case an error occurs if the number of columns is not equal to the number of columns in the previous table. Absence of the "+" means that the table is to be printed on a new page with the table title, banner labels and other standard options that may have been requested. See also format LBT.

Table names may be up to 8 characters in length, and the name chosen has no particular significance. The characters may only be alphanumeric (A-Z, 0-9) unless you put the table name in quotation marks whenever it is referenced. The name used is printed with the table, unless either

F=NTID (No Table ID)

or

the automatic table numbering feature is invoked by format ATN, in which case each table is given a numeric ID, the numbers increasing by 1 for each non-suppress heading table

or

the ID parameter is used, in which case 'text' is used as the table ID

Tables may be redefined, that is, there may be more than one command to increment the same table. In this case, the number of cells in the redefinition must be the same as in the original definition.

The number of rows in the table must not exceed 300000, the number of columns must not exceed 1000.

If the stub or banner labels contain <V> label controls and the appropriate formats are set, distribution tables generate table-based statistics at print time. If it is required only to print the statistics part of the table, F=NDIS (No Distribution) may be used.

Note that statistical functions, chi-square, Kolmogorov-Smirnov, Mann-Whitney, medians, quartiles, Minimum and Maximum, can only be produced from distribution tables, not statistics tables.

Examples of T distribution tables:

t #1 = $sex * $age,

t #34a(f=rth/dpt2/med)=$s16*$m17+$widget,

+t #n116(f=nprc)(id='116a')=$row3*$break,

Following is an example of a banked table with three independent columns. The third column is weighted by $QUANT.

ds $cols=f,f,f,

xt = 'columns for table one', 

x = 'one;two;three', 

t #1 (f=nitb) = $row1 * $cols,

vt = 'banked table', 

t #1 = $row1 * 1,

t #1 = $row2 * 2,

select wq $quant,

t #1 = $row3 * 3,

select wq 1,