Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: AW:AW: an egen command


From   "Lachenbruch, Peter" <Peter.Lachenbruch@oregonstate.edu>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: AW:AW: an egen command
Date   Tue, 16 Feb 2010 08:23:27 -0800

With all of these good ways to generate the dichotomous variable, I would question why you want to do this in the first place.  You lose information, you may not know if this is the 'best' cutpoint, etc.  You could also consider the response as a function of the continuous variable.

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Martin Weiss
Sent: Tuesday, February 16, 2010 3:58 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: AW:AW: an egen command


<> 

" I am using egen to create new variables."



BTW, the call to -egen- would have looked something like this:


*************
egen byte var2 = cut(mpg),  /* 
*/ at(`r(min)' ,`r(mean)' ,`=r(max)+1') /* 
*/ icodes
*************



HTH
Martin





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

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index