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: RE: st: A bug in egen and gen?


From   Maarten buis <[email protected]>
To   [email protected]
Subject   RE: RE: st: A bug in egen and gen?
Date   Fri, 18 Feb 2011 16:31:24 +0000 (GMT)

--- On Fri, 18/2/11, Liao, Junlin wrote:
> You may have most of the variables in decimal and double
> could very well inflate your dataset to double its size. But
> I doubt the majority of Stata users are not in that camp.

My guess would have been that the majority does have most 
variables as non-integers, but if there is one thing I have
learned from the Statalist is that the way Stata is used and
the kind of problems people run into is far more heterogenous
than I could have ever dreamed of, so I am not willing to 
call this anymore than a guess.

> The -compress- command missing opportunity to reduce double
> to float can be easily demonstrated.
> 
> . set type double
> 
> . clear
> 
> . gen a=4.1

<snip>

If you really believe that your data is so precisely
measured that it needs to be entered as doubles, than
you should not convert double 4.1 to float 4.1; they
are not the same number:

. di %21x 4.1
+1.0666666666666X+002

. di %21x float(4.1)
+1.0666660000000X+002

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