-------------------------------------------------------------------------------
help for lablist                                                 (Roger Newson)
-------------------------------------------------------------------------------

List value labels (if present) for one or more variables

lablist [ varlist ] [ , varlabel ]

Description

lablist produces a list of the values and value labels used by the value label sets belonging to each of a list of variables, if such value label sets are defined. If no varlist is specified, then lablist uses the full list of variables in the dataset currently in the memory. lablist is therefore similar to label list, but it requires the user to specify only the variable name(s) in the varlist, instead of specifying the value label set(s) belonging to the variable(s). It is often used with tabulate, or with the SSC package xcontract.

Options

varlabel specifies that variable labels will be printed (if present), in addition to any value labels.

Examples

. lablist

. lablist mpg

. tab foreign . lablist foreign

. lablist, varlabel

. lablist foreign, var

Saved results

lablist saves the following in r():

Scalars r(k) number of mapped values, including missing r(min) minimum nonmissing value with a label r(max) maximum nonmissing value with a label r(hasemiss) 1 if extended missing values labeled, 0 otherwise

If multiple variables are specified in the varlist, then the saved results are for the last variable in the varlist with a value label.

Author

Roger Newson, National Heart and Lung Institute, Imperial College London, UK. Email: r.newson@imperial.ac.uk

Also see

Manual: [D] label, [D] tabulate oneway, [D] tabulate twoway On-line: help for label, tabulate, tabulate oneway, tabulate twoway, help for xcontract if installed