Title

tstats -- Table of statistics

Syntax

tstats [C-function spec] [if] [in], [options]

by(details) Defines groups over which statistics are calculated, and their arrangement

swap Display statistics down rows, instead of across columns

nest Display statistics under variable names

Description

tstats calculates and displays tables of statistics.

If you specify C-function spec using vars-by-funcs syntax (which includes specifying no main parameter), tstats will (by default) create a table of vars X stats.

Options

by(details) -- The full syntax is:

by(varelist [, firstvar lastvar overall columns ])

by(varelist) works as you'd expect: partitioning the dataset before calculating statistics for each part.

Understanding firstvar and lastvar to be the first and last variables in by(varelist):

firstvar adds statistics by(firstvar)

lastvar adds statistics by(lastvar)

overall adds overall statistics (ie, without by())

columns causes lastvar to be broken out across columns, rather than rows.

swap re-arranges the display so that stats are row-headings rather than column-headings. With vars-by-funcs syntax, vars will become column-headings.

nest causes tstats to use the usual stats-nested-in-vars display, rather than the vars X stats display, when vars-by-funcs syntax is used.

Variables from the main parameter and/or the by() option may be present in the display. When both are present, nl1 governs main parameter variables, and nl2 governs the by() variables.

vl1 governs the body of the table. vl2 governs headings.