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]

st: _00001 already define error using egen xx=group()


From   Barry Quinn <[email protected]>
To   "statlist ([email protected])" <[email protected]>
Subject   st: _00001 already define error using egen xx=group()
Date   Mon, 26 Sep 2011 08:32:19 +0100

Hi, 

 I have been running the egen xx= group() command to produce coding which allows me to choose 3 of the four possible pairs when combining two binary variables.
Recently the above error has started to appear.

Example:

Say I have two binary variables D(0,1) & B(0,1)
I want to run a command choosing the groups (D=0 & B=1) , (D=1 & B=0) , (D=1 & B=1) and not the group (D=0 & B=0).
I find the egen group() command does this well by creating a variable from 1 to 4 for each possible combination of the two binary variables and then I run my command using
......if  xx>1

My problem is when I run this command I get the error
__000000 already defined
__000001 already defined

For reference here is the full code I am running and the resultant error:

.clear
. use panelcleanappend
. capture drop w
. gen w=runiform()
. sort treat w
. capture drop insample
. gen insample=_n<=1000
. drop id1
. egen id1=group(insample oneyear)
__000000 already defined
__000001 already defined

Any help with this error or a possible another way to choose the above groups would be appreciated

Thanks

Barry Quinn
Lecturer in Finance

Queens University Belfast              Tel: 028 9097 4824
Riddel Hall                                       www.qub.ac.uk/mgt
185 Stramillis Road                         www.barryquinn.com
Belfast                                             [email protected]
Northern Ireland 
BT9 5EE                      


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