Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: entire contents of a value label


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: entire contents of a value label
Date   Wed, 1 Dec 2004 13:53:36 -0500

Phil Schumm enquired about getting the contents of a value label...this does not deal with labels for missing value codes, but it should deal with the rest:

use http://www.stata-press.com/data/r8/labelbook1.dta,clear
* zap one to make sure that it works with gaps
label define rs015 3 "", modify
label list rs015

forv i=`r(min)'/`r(max)' {
local labval: label rs015 `i'
if ("`labval'" ~= "`i'") local rs015lab "`rs015lab' | `labval'"
}
di "`rs015lab'"


Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index