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

st: Precision

From   "Ronnie Babigumira" <>
To   <>
Subject   st: Precision
Date   Fri, 11 Nov 2005 12:04:56 +0100

Dear all
I have scanned some of the previous posts on this subject but I am not
making any headway.

I have text file with two variables whose contents are 16 digit numbers
of the form


I would like to import the data into stata whilst maintainig the
precision. Here is what I have done. I import the variables as strings
and that works. However, the next challenge is that they need to be used
as numeric variables (this is the hair loss part). I have tried

gen y = real(x)
destring x, gen(y)

Both dont have an option to specify the format. Trying to format the
generated variables also wont help since format y %9.11f  gives me the
dreaded red lines and blue lines

invalid %format

So my question is how can I change x from string to numeric whilst
maintaining the precision. Or even better, how best can I import this
into stata as a numeric variable without loss of precision.

*   For searches and help try:

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