[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: Data problem (was: Majordomo results)
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.
----- Original Message -----
From: "Ulrich Kohler" <firstname.lastname@example.org>
Sent: Wednesday, April 21, 2004 9:23 AM
Subject: Re: st: RE: Majordomo results
> email@example.com 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
> -outdat- is to write a dataset to an ASCII File and to write dictionaries
> various statistical packages (i.e. Limdep, SQL, Rats, RUMM, Stata, SPSS)
> read and label that ASCII-File. Before saving the ASCII-File, outdat sets
> fixed display-format for each variable according to the storage type. If
> take care of the storage type (-compress-), and -outdat- afterwards, you
> should get what you want.
> To install type
> . ssc install outdat
> Many regards
> * 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: