Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: RE: Re: A problem with egen??


From   "George M Hoffman MD" <ghoffman@mcw.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: RE: Re: A problem with egen??
Date   Tue, 3 May 2005 21:47:40 -0500

yes, of course you are rigth, and i keep learning! thanks
george hoffman

----- Original Message ----- 
From: "Nick Cox" <n.j.cox@durham.ac.uk>
To: <statalist@hsphsun2.harvard.edu>
Sent: Tuesday, May 03, 2005 6:50 PM
Subject: st: RE: Re: A problem with egen??


This isn't the problem. Underneath 
the different syntax, these have
identical effects, setting aside 
side-effects on sort order. 

Nick 
n.j.cox@durham.ac.uk 

George M Hoffman MD
 
> you are repeating the egen on the whole sample, as you found out.
> you want to have the 'by' as a modifier of egen. 
> try:
> egen X_5 = pct(X), by(country)
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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