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

st: Why does Stata do it wrong?


From   Tesfayi Gebre <tesfaron@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Why does Stata do it wrong?
Date   Mon, 9 Jun 2003 05:45:35 -0700 (PDT)

Dear Statlister,

I want to generate a single unique id to merge files
by using variables: var1 (F1) var2 (F3) var3 (F4) and
var4 (F2), where F shows the integer width (f format).
So, I used 

gen id = var1*10^9 + var2*10^6 + var3*10^2 + var4

This is the output from stata and the true id (as it
should be) for the following
example:

var1   var2   var3  var4   id (stata)   id (true)
1      2      3452   1     1005452032	1002345201
1      121    34     10	   1121033984	1121003410
2      23     156    2     2023155968	2023015602
2      45     3      2     2045003008	2045000302
3      6      4      3     3006003968	3006000403
3      70     8      5     3070008064	3070000805

Why is the stata id different from the true id? Does
stata store numbers in different format?

Thank you!

Tesfayi

 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index