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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: In search of the lost precision


From   Farshad Pourmalek <pourmalek_farshad@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: In search of the lost precision
Date   Fri, 1 Jul 2011 06:03:18 -0700 (PDT)

Thank you. .format <varname> %17.0g resolves the issue. Best, farshad

--- On Thu, 6/30/11, Gary Longton <glongton@fhcrc.org> wrote:

> From: Gary Longton <glongton@fhcrc.org>
> Subject: Re: st: In search of the lost precision
> To: statalist@hsphsun2.harvard.edu
> Date: Thursday, June 30, 2011, 3:39 PM
> <>
> The precision is likely not lost, just hidden.  I
> suspect the problem is with with the display format (%10.0g)
> and not the storage precision, as doubles should have 16
> digits of accuracy.
> see -help format-, and try:
> 
>   .format <varname> %17.0g
> or
>   .format <varname> %17.15f
> 
> - GL
> 
> 
> On 6/30/2011 12:04 PM, Farshad Pourmalek wrote:
> 
> > Is there a way to insheet 0.154143995764484 without
> losing precision?
> > 
> > I used Stata IC 9.1 for Windows as below
> > 
> > insheet using "C:\data\0.154143995764484.csv", clear
> > codebook
> > * It is float, %9.0g, .15414399, not .154143995764484
> > 
> > insheet using "C:\data\0.154143995764484.csv",clear
> double
> > codebook
> > * It is double, %10.0g, .1541439957645, not
> .154143995764484
> *
> *   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/
> 

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