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

Re: st: RE: Majordomo results


From   Ulrich Kohler <kohler@wz-berlin.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Majordomo results
Date   Wed, 21 Apr 2004 15:23:50 +0200

tchamour@copper.net wrote:
> I have posed the questions to Stata tech support, but the answers
> have not been entirely satisfactory.  I would really appreciate your
> help in this:
>
> 1) Is there a Stata command to export data (to text format for
> example) which does not use the display format of the variables (but
> instead uses the storage format)?
> 2) If not, is it possible to export with a dictionary (the reverse of
> infilling with a dictionary), or is this done by manipulating the
> display formats prior to the export?
> 3) How can one make sure that there is no precision lost (however
> insignificant that may be) if one has to export data from a Stata
> file (assuming the import into Stata was done correctly), and does
> not have the "raw data" for comparison purposes (i.e. does formatting
> all vars to something like %17.6f take care of that)?
>
> For example:
> If I use insheet to import 103192286.98 into Stata, and then outsheet
> the record I get back something like 1.03e+08.  Why is this
> happening?  Stata reads in the variable as a float, and assigns a
> display format of %9.0g.  Even if I change the display format, I
> still get a rounding error (and if I check in the browser, the number
> is 1.03e+08).

I think -outdat- downloadable from SSC comes near to what you want. The aim of 
-outdat- is to write a dataset to an ASCII File and to write dictionaries for 
various statistical packages (i.e. Limdep, SQL, Rats, RUMM, Stata, SPSS) to 
read and label that ASCII-File. Before saving the ASCII-File, outdat sets a 
fixed display-format for each variable according to the storage type. If you 
take care of the storage type (-compress-), and -outdat- afterwards, you 
should get what you want.

To install type

. ssc install outdat

Many regards
Uli



*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index