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

st: Re: Data problem (was: Majordomo results)


From   "Steichen" <[email protected]>
To   <[email protected]>
Subject   st: Re: Data problem (was: Majordomo results)
Date   Wed, 21 Apr 2004 12:19:59 -0400

The more important issue here is that a number with 11 digits of precision
was read into a float variable that only allows for ~7 digits of precision.
No manipulation of display format can correct this initial problem.  The
solution is to import the number into a Stata double precision variable,
which has ~12 digit precision.

Tom


----- Original Message ----- 
From: "Ulrich Kohler" <[email protected]>
To: <[email protected]>
Sent: Wednesday, April 21, 2004 9:23 AM
Subject: Re: st: RE: Majordomo results


> [email protected] 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/
>

*
*   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