Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: Extra decimal places
From 
 
Maarten buis <[email protected]> 
To 
 
stata list <[email protected]> 
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/