Title
labelsof -- Obtain list of labeled values
Syntax
labelsof varname [ , label ]
Description
labelsof displays and returns in r(values) and r(labels) the labeled values of varname. labelsof returns nothing if varname has no value labels assigned.
Options
label causes the specified name to be interpreted as a value label name rather than a variable name and returns the values and labels contained in this set of value label definitions.
Examples
. sysuse auto (1978 Automobile Data) . labelsof foreign foreign (origin): 0 Domestic 1 Foreign . ret list macros: r(name) : "origin" r(values) : "0 1" r(labels) : "`"Domestic"' `"Foreign"'" . label define yesno 1 "yes" 2 "no" .a "no answer" . labelsof yesno, label yesno: 1 yes 2 no .a no answer . ret list macros: r(name) : "yesno" r(values) : "1 2 .a" r(labels) : "`"yes"' `"no"' `"no answer"'"
Author
Ben Jann, ETH Zurich, jann@soz.gess.ethz.ch
Also see
Online: label, labelbook