Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: more than double precision (higher than 16 digit)


From   "Michael N. Mitchell" <Michael.Norman.Mitchell@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: more than double precision (higher than 16 digit)
Date   Sun, 28 Nov 2010 18:47:26 -0800

Dear Nicola

  I wonder if you might make a new id variable based on the string variable like this...

sysuse auto
egen id = group(make)

Then you could use the new id variable for the program that requires the numeric id variable.

I hope that helps,

Michael N. Mitchell
Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week         - http://www.MichaelNormanMitchell.com



On 2010-11-28 4.27 PM, Nicola Man wrote:
Hi,

I am having problems with precision for a numeric variable (it is an ID variable).  I have been keeping it as a string variable as there are more than 16 digits (the maximum number of exact digits stored in double precision, which problem I also encountered in other softwares like Excel and SPSS).

However, I now want to do some computation with a user-written program in STATA that needs it to be stored as a number.  Would be great if someone would help me with this.

Thanks!
Nicola
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index