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   "Liao, Junlin" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: RE: st: A bug in egen and gen?
Date   Fri, 18 Feb 2011 16:41:18 +0000

Maarten,

Out of curiosity, do you know the maximum difference that the -recast- procedure allows to recast a variable from double to float?

Junlin

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Maarten buis
Sent: Friday, February 18, 2011 10:31 AM
To: [email protected]
Subject: RE: RE: st: A bug in egen and gen?

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


________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________

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