Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Changing characters and letters in all value labels


From   daniel klein <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Changing characters and letters in all value labels
Date   Thu, 24 Oct 2013 14:35:03 +0200

I suspect Maria wants to change value label names not value labels
(the text associated with integers). For this she wants to use my
-labren- command. Otherwise she may use -labvalch3-. The following
applies to both.

There might be a problem using the programs in their current version,
if the letter z appears more than once in the value label (name)s and
only the first occurence is to be changed, which is suggested by
Maria's code to change variable labels.

labren ,subst("a" "z")

will change label name <banana> to <bznznz> not <bznana>. To to do the
latter, the more complicated syntax would be

labren ,strfcn(subinstr("@", "a", "z", 1))

I have fixed this inconvenience (and other minor things) recently, but
have not yet sent the updated file(s) to Kit Baum.

Best
Daniel

-- 
> Look in Daniel Klein's -labutil2- (SSC).
> Nick
> [email protected]
>
>
> On 24 October 2013 09:48, maria t <[email protected]> wrote:
>> Hi statalist members,
>>
>> I would like to remove certain letters and characters in all my value labels and replace them with other ones.
>>
>> I have used the following program to change the letter "z" to "a" in all the variable labels, but I can't find out how to do the same for the value labels.
>> I would be very grateful if any of you could help m
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index