Title

tfreq -- Tabulate

Syntax

tfreq [varelist] [if] [in] [fweight] [, options]

Modifiers Description

(.) Collapse all non-missing values to a single value.

options

row display % of row-total

col display % of column-total

cell display % of grand total

nofreq do not display frequencies

nomissing do not display missing values

allrows display all combinations of row values

valcols arrange values of the final variable as columns

novalcols arrange all combinations of values as rows

sort[(details)] sort the table

vertical arrange dual statistics vertically rather than horizontally

Description

tfreq produces n-way cross-tabulations. There are two main layouts: with and without value columns.

In a (default) two-way cross-tab, values of the first variable define rows and values of the second variable define columns.
If you specify novalcols, every combination of values will define a row.

When more than two variables are cross-tabulated, every combination of values will, by default, define a row. If you specify valcols, the values of the final variable will define columns instead.

Modifiers

The single available modifier, (.) will cause all non-missing values to be treated as the single value non-missing. Missing values will be treated normally; that is, they will be individually (cross-)tabulated.

Options

row, col, and cell add the relevant % to each cell of the display. These options also implicitly specify (and require) valcols.

nofreq suppresses the display of frequencies; it is only valid in conjunction with row, col, and/or cell.

nomissing restricts the display to cases in which no variables are missing.

allrows includes 0-frequency rows in the display. This ensures that every row value-combination is displayed.

valcols specifies that values of the final variable define columns, rather than being combined with the other values to define rows. This is the default when two variables are specified.

novalcols specifies that each combination of values define a row. This is the default when more than two variables are specified.

sort[(details)] -- The full syntax is:

sort

or

sort( [freq | label | value] [reverse] )

where:

freq sorts by cell frequencies.

label sorts by labeled value

value sorts by unlabeled value

reverse sorts in descending rather than ascending order

o- If reverse is specified without an index, freq is used.

o- Similarly, sort is a shortcut for sort(freq).

vertical changes the arrangement of statistics within cells. When exactly two statistics per cell are specified, they are arranged side-by-side by default. This option changes the arrangement to above-and-below.

nl1 governs the row-variable headings, and nl2 governs the column-variable headings (if any).

vl1 governs the row-value headings and vl2 governs the column-value headings (if any).

Weight

The weight syntax is (still) non-standard. It can be:

[ fweight=varname ]

or just

[ varname ]