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: RE: RE: RE: AW: Decimal Precision with Destring


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: RE: RE: AW: Decimal Precision with Destring
Date   Mon, 19 Apr 2010 19:35:42 +0000 (GMT)

--- On Mon, 19/4/10, Sutton, Bennett W. wrote:
> I know these are insanely small hairs to be splitting, but
> unfortunately this work is going into a publication and I
> need to make sure that the rounded result will be 4.5 and
> not 4.6.  (not just here but in many, many other 
> calculations.)

If reproducability across programs is your aim, then your
best bet is probably to multiply your variables with some
multiple of 10 such that the largest value of each variable
has 9 digits after the decimal point, round the variables,
and than store these  variables as -long-s (with the 
factors). Computers have much less trouble representing 
integers, so this way you are more likely to get the same 
results across computer programs.

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