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

st: RE: Re: generating a new variable with the egen command


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Re: generating a new variable with the egen command
Date   Mon, 28 Nov 2005 15:46:59 -0000

No, it is not weird. By default -egen- here 
produces a -float-, unless the user 
has -set type-, in which case the question
would presumably not arise. 

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

Rodrigo Alfaro
 
> This sounds weird, try the following steps:
> 
> sort id year
> by id year: egen double newvar=sum(oldvar)
> 
> then list, sum or tab to see the values of newvar.
> 

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