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: extending levelsof to more than one variable


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: extending levelsof to more than one variable
Date   Fri, 29 Jun 2012 15:49:58 +0100

Second line needs the -egen- call. 

Nick 
[email protected] 


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Maarten Buis
Sent: 29 June 2012 15:33
To: [email protected]
Subject: Re: st: extending levelsof to more than one variable

On Fri, Jun 29, 2012 at 4:27 PM, Pradipto Banerjee
<[email protected]> wrote:
> I have a code below that I use as follows: "by group1 : egen var1new = neutralize (var1 var2 var3)" . The problem is that if I extend it to "by group1 group2 : egen var1new = neutralize (var1 var2 var3)" or "by group1 group2, sort : egen var1new = neutralize (var1 var2 var3)"  etc., then the code does not work as it depends upon levelsof to loop.

egen groupgroup = group(group1 group2)
by groupgroup : neutralize(<whatever>)

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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