help for slist

Smart listing of variables

slist [varlist] [if exp] [in range] [, decimal(number) id(varlist) noobs label]

by ...: may not be used with slist.

varlist may contain any variable types; see help varlist.


slist for Stata 7 and 8 displays compact lists fitting current width of output window. If more than one line is needed, a new block of variables is created.


decimal(number) lets you select the number of decimals for floating point numbers. If omitted, slist uses general format.

id(varlist) ensures that one or more id variables are displayed at the beginning of each line.

noobs omits observation numbers. Frequently used in combination with id(varlist).

label lists value labels instead of numerical codes for variables having value labels


The list command is clumsy in displaying lists with more than a few variables. slist displays compact lists with numeric codes. Value labels are only shown when explicitly requested.

slist compresses the data in memory and finds the most economic formats. This may take some time with large uncompressed data sets, and it is recommended to keep your data in compressed form, for this and other reasons; see compress. After completion the original data format is restored.

IF you wish a permanent change of display formats, see format or automatic formatting with aformat. aformat is available from the Statalist source code archives (ssc-ideas)


. slist . slist v1-v27 . slist , decimal(2) . slist v1-v27 in 1/20 if sex == 1 . slist v1-v27 , noobs id(idno) . slist , label

. slist in 3/4 , d(2) id(idno)

idno sex age wt ht smoke cigaret cheroot pipe agegr 3. 7 1 49 85 190 1 10 2 0 2 4. 11 2 71 85 166 2 0 0 0 3

idno tobacco bmi bmigr 3. 7 14 23.55 20 4. 11 0 30.85 30

. slist idno sex smoke in 3/4 , label

idno sex smoke 3. 7 M Yes 4. 11 F No

Authors Svend Juul, Department of Epidemiology and Social Medicine, University of Aarhu > s, Denmark. JM.Lauritsen, Accident Analysis Group, Odense University Hospital, Denmark. John Gallup developIT.org, USA.

Also see Help for list, format, aformat, compress