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]

st: AW: Extra decimal places?


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Devora Shamah
Gesendet: Dienstag, 8. Juni 2010 17:27
An: statalist@hsphsun2.harvard.edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index