Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Stop Stata rounding up decimal places when import from Excel


From   Maarten Buis <maartenlbuis@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Stop Stata rounding up decimal places when import from Excel
Date   Wed, 1 Aug 2012 16:18:10 +0200

On Wed, Aug 1, 2012 at 3:33 PM,  <Sorada.Tapsuwan@csiro.au> wrote:
> In my excel file I have one variable that has 7 digits and 7 decimal places, e.g. 1234567.1234567.
>
> When I import the file into Stata, it rounds up the decimal place of the variable to 1234567.12
>
> How can I change the setting so that Stata would not round up my decimal places?

You need to make sure to import that variable as a double not as a float.

For (much) more see :
<http://blog.stata.com/2012/04/02/the-penultimate-guide-to-precision/>

Hope this helps,
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index