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: Recode and Label problem


From   daniel klein <[email protected]>
To   [email protected]
Subject   Re: st: Recode and Label problem
Date   Wed, 17 Oct 2012 09:11:58 +0200

... please ignore the part I wrote on -replace- -- at least for this
case. Here 1 indicates a "yes", so substracting 1 from the original
variable will not work.

Note that there is no need to use -label drop-, as -label define- has
a -modify- (and -replace-) option that allow you to change exisitng
value labels.

Best
Daniel

-- 
[...]
I just wanted to point out a faster
solution

replace <foo> = <foo> - 1 if !mi(<foo>)

will give the same binary indicator, but -replace- (or -generate-, if
you want a new variable) is much faster than -recode- (might not be a
problem in a simple do-file, though).
*
*   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