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

RE: st: Data types, collapse & egen

From   "McKenna, Timothy" <>
To   <>
Subject   RE: st: Data types, collapse & egen
Date   Mon, 12 Sep 2005 19:33:06 -0400

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:
Rather than:

To stop this behavior you need to change the display format of your
variable to something like %12.0g.


-----Original Message-----
[] On Behalf Of Alan Riley
Sent: Monday, September 12, 2005 6:59 PM
Subject: Re: st: Data types, collapse & egen

Eric Wruck ( 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

I recommend that Eric send an email to
and attach a dataset and do-file which can be used to reproduce
the result.

*   For searches and help try:
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:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index