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

st: outsheet - insheet

From   "Sascha O. Becker" <>
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
Fax +49 (89) 39 73 03
* For searches and help try:

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