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

Nick [snip]
*   For searches and help try:

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