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 on April 23, and its replacement, 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 <>
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.


I just wanted to point out a faster

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:

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