How are you figuring out the values in your collapsed dataset?
It sounds like you are using -outsheet- to output the data (or are
displaying it using -list-). If so then the data is outputted using its
display format. If your display format is %X.0g then it could write to
the text file something like:
1.045e+09
Rather than:
1,045,855,825
To stop this behavior you need to change the display format of your
variable to something like %12.0g.
-Tim
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Alan Riley
Sent: Monday, September 12, 2005 6:59 PM
To: [email protected]
Subject: Re: st: Data types, collapse & egen
Eric Wruck ([email protected]) asks about datatypes and rounding:
> ...
> But instead of values such as 1,045,855,825 I get 1,046,000,000
> instead. I looked at help for double & learned that the min & max
> values for that data type are enormous.
> ...
The number 1,045,855,825 is certainly within the number of digits
of precision offered by the double datatype. It is hard to determine
why Eric is seeing 1,046,000,000 rather than the desired result
without seeing all of the steps that were followed to calculate this
value.
I recommend that Eric send an email to [email protected]
and attach a dataset and do-file which can be used to reproduce
the result.
--Alan
([email protected])
*
* 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/
_____________________________________________________________
This e-mail and any attachments may be confidential or legally privileged. If you received this message in error or are not the intended recipient, you should destroy the e-mail message and any attachments or copies, and you are prohibited from retaining, distributing, disclosing or using any information contained herein. Please inform us of the erroneous delivery by return e-mail.
Thank you for your cooperation.
_____________________________________________________________
*
* 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/