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: Extra decimal places


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   stata list <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Extra decimal places
Date   Tue, 8 Jun 2010 08:35:09 -0700 (PDT)

--- Devora Shamah wrote:
> I am having an issue with Stata adding places to decimal values. In 
> preparation to append and merge the datasets I added a decimal number to 
> the id codes based on the school id to ensure that id was unique across 
> all the datasets. 
>
> For example:
> gen id=  ApplicationTableID+.3
>
> I have discovered that the actual values range from X.29999 -X.3002.

For the reason see: <http://www.stata.com/support/faqs/data/prec.html>

A solution is:
gen long id=  10 * ApplicationTableID +3

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