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   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: extending levelsof to more than one variable
Date   Fri, 29 Jun 2012 16:33:20 +0200

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

-- Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany


http://www.maartenbuis.nl
--------------------------

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