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

Re: st: accuracy and preserving uniqueness of id

From   Philip Ryan <>
Subject   Re: st: accuracy and preserving uniqueness of id
Date   Wed, 26 Feb 2003 09:27:33 +1030

It look like you are reading in your -id- variable as a floating point number. You cannot expect 18 digits of accuracy. It's almost always best to read a long id variable in as a *string* variable.


At 05:33 PM 25/02/2003 -0500, you wrote:

dear all,

i'm using -infix- to read in a large dataset into stata. each line of the
dataset begins with an 18 character, numeric, company identification
block. each company occupies several lines, that all start with the same
identification code. to make things clearer here's my sample code:

infix id 1-18 reccat 19-20 var1 21-25 var2 26-30 ... if reccat=11
infix id 1-18 reccat 19-20 var3 21-23 var4 24-27 ... if reccat=12

after i ran this i took a look at my resulting dataset and to my surprise,
the id displayed by Stata looked very different from the id i originally
had in my flat text file.

for example:

in text, id = 200101380110999991
in stata, id= 200101375269404672


in text, id = 200101380206999991(different from above)
in stata, id= 200101375269404672(same as above)

what's bothering me is that ids that are different in text become the same
in stata. is there a way to preserve the accuracy and hence uniqueness of
the ids in this situation?

thanks in advance,

Radu Ban

*   For searches and help try:
Philip Ryan
Associate Professor
Department of Public Health
University of Adelaide 5005
South Australia
tel 61 8 8303 3570
fax 61 8 8223 4075

This email message is intended only for the addressee(s)
and contains information which may be confidential and/or
copyright. If you are not the intended recipient please
do not read, save, forward, disclose, or copy the contents
of this email. If this email has been sent to you in error,
please notify the sender by reply email and delete this
email and any copies or links to this email completely and
immediately from your system. No representation is made
that this email is free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.

*   For searches and help try:

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