Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Recode and Label problem


From   daniel klein <klein.daniel.81@googlemail.com>
To   statalist@hsphsun2.harvard.edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index