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

Re: st: RE: Getting at value labels


From   Arnold Kester <[email protected]>
To   [email protected]
Subject   Re: st: RE: Getting at value labels
Date   Fri, 13 Feb 2004 14:59:18 +0100

Two missing quotes and a missing part in the label string, imho.

Nick Cox wrote:
I would do this. I assume value labels attached
to -marEduc-.
separate aRate, by(marEduc) shortlabel local aRatevars "`r(varlist)'" twoway connected `aRatevars' year
Sometimes even the -shortlabel- is too long. (There should be an option -veryshortlabel-
to go beyond the -shortlabel- I suggested a while back.)
ssc inst labutil labnoeq `aRatevars'
will cut them down further. The first principles
way to do that is something like
foreach v of local aRatevars { local label : variable label `v'
Here a ' missing:

	local eq = index(`"`label'"', "=") - 1
and here a ' and the second part of the string

local label = substr(`"`label'"',1,`eq')+substr(`"`label'"',`eq'+4,.) label var `v' `"`label'"' }
I'd been looking for this for some time, so I tried it right away. Thanks.
 Arnold


Nick [email protected] [snip]
*
*   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