Bookmark and Share

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]

st: AW: Extra decimal places?


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: Extra decimal places?
Date   Tue, 8 Jun 2010 17:44:23 +0200

<> 

Same reasoning as in Nick`s
http://www.stata.com/statalist/archive/2010-06/msg00429.html 

When I use -double- as data type, as Maarten said, the numbers are correct
after -xmlsave-ing and opening in spreadsheet software...

***
clear*
set obs 100
gen id=  _n+.3
gen double id2=  _n+.3
xmlsave "myxmlfile", doctype(excel) replace
***


HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Devora Shamah
Gesendet: Dienstag, 8. Juni 2010 17:27
An: [email protected]
Betreff: st: Extra decimal places?

Hello All,

I am having an issue with Stata adding places to decimal values. I am using
Stata 11.0. I have several datasets that I pulled from Access using
StatTransfer. 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

id is a numeric variable, formatted as %9.0g

I have discovered that although the id numbers all read X.3, the actual
values range from X.29999 -X.3002 which shows up when we move the data into
excel and on some of the tables.

The files have been compressed, and reshaped. Does anyone know why Stata
assigns varying values across the observations?

Thanks,

Devora


Devora Shamah, Ph.D.
Manager, Research and Reporting

Gateway to College National Network
529 SE Grand Ave. #300
Portland, OR 97214
phone: 971.634.1203
fax: 971.634.1213
www.gatewaytocollege.org



*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index