I'm generating graphs for several variables using a do-file, I would like to be able to retrieve a variable label (so that I could use it for the graph title).
In my dreams, something along those lines:
sysuse auto, replace
local pricelabel = varlab(price)
display "Label for price variable is `pricelabel'"
which would (in my dreams) yield:
Label for price variable is Price
I looked in the documentation of describe, summarize, as well as the part on labels, but could not seem to find a solution.
See the help files for extended functions of local/global macros:
help extended_fcn
(whereextended_function
isvariable label varname
[what you asked for] orvalue label varname
[not what you asked for, but may be of use]). E.g.:returns