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

Re: st: entire contents of a value label


From   Nick Winter <[email protected]>
To   [email protected]
Subject   Re: st: entire contents of a value label
Date   Wed, 01 Dec 2004 14:45:37 -0500

You could also pick up extended missings with this, after the current forv loop:

if `r(hasemiss)' {
foreach l in `c(alpha)' {
local labval : label rs015 .`l'
if ("`labval'" ~= ".`l'") local rs015lab "`rs015lab' | `labval'"
}
}


--Nick Winter


At 01:53 PM 12/1/2004 -0500, you wrote:

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/
--------------------------------------------------------
Nicholas Winter 607.255.8819 t
Assistant Professor 607.255.4530 f
Department of Government [email protected] e
308 White Hall falcon.arts.cornell.edu/nw53 w
Cornell University
Ithaca, NY 14853-4601

*
* 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