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: still for Stata 14: a new cases function complementing cond and recode


From   William Buchanan <[email protected]>
To   [email protected]
Subject   Re: st: still for Stata 14: a new cases function complementing cond and recode
Date   Thu, 12 Sep 2013 17:04:55 -0500

So what would you do in the case where you needed to assign multiple values to a single value?  From the recode help file:

webuse fullauto, clear
recode rep77 rep78 (1 2 = 1 "Below average") (3 = 2 Average) (4 5 = 3 "Above average"), pre(new) label(newrep)

And changing the way that you interact with the code (e.g., the command/function that you call) does not necessarily imply restructuring the architecture of the underlying program, so there is no reason that this would be any faster/slower than what is already in place.  So I fail to see how your suggestion would render "the ridiculously slow -recode- command obsolete." 


Billy
On Sep 12, 2013, at 4:29 PM, László Sándor <[email protected]> wrote:

> It would be nice to have a "cases" function built in, instead of
> resorting to nested conds as the only, unpopular alternative to many
> lines of "replace if"s following an initial -gen-. Way too many
> processor hours are wasted worldwide on not having a function like
> -recode()- but only slightly complicated:
> cases(condition1,value1,condition2,value2,…,value_if_none_true)
> 
> Btw, this would also make the ridiculously slow -recode- command obsolete.
> 
> Thanks,
> 
> Laszlo
> 
> *
> *   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/


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