Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: outsheet - insheet


From   "Sascha O. Becker" <[email protected]>
To   [email protected]
Subject   st: outsheet - insheet
Date   Sun, 16 May 2004 20:13:58 +0200

Dear Stata users,

in a project, we have to -outsheet- a Stata data set, and after some intermediate steps on a mainframe computer, -insheet- the data again.

When doing some tests with -outsheet- and -insheet- it turns out that after insheeting variables and comparing them to the original variables using Stata's -compare-, values differ. Here is what I do:

***
/* data set contains variables var1 and id */
save using original.dta
outsheet using test.csv, comma
insheet using test.csv, clear
rename var1 var1_new
merge id using original
compare var1 var1_new;

---------- difference ----------
count minimum average maximum
--------------------------------------------------------------------
var1<var1_new 89433 -.0005035 -.000129 -7.45e-09
var1=var1_new 6097
var1>var1_new 89019 7.45e-09 .0001295 .0005035
----------
jointly defined 184549 -.0005035 -7.35e-08 .0005035
----------
total 184549
***

Admittedly, the differences are not large. Is there a way to make sure values do NOT change AT ALL after outsheet - insheet?

One remark: the problem only seems to come up with floats and doubles but not with integers.

Does -outsheet- work for integers (and bytes) only?

Best, Sascha

--

Dr. Sascha O. Becker
Center for Economic Studies
University of Munich
Schackstr. 4 - 80539 Munich, Germany
Tel +49 (89) 2180-6252 http://www.lmu.de
Fax +49 (89) 39 73 03 [email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index