You are not logged in. You can browse but not post. Login or Register by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the FAQ.
I am merging data and some of my ID variables have decimal places. I tried using the real function but that did not work. Is it possible to remove them? Thank you
Yes, it's possible. The question is, though, whether (and how) you can do that safely, that is, without undermining their integrity (ability to distinguish between entities). You can simply round or truncate them to the nearest integer, but you risk mapping distinct ID values to the same integer. You can multiply them by some fixed power of 10, and then round or truncate, but you'll need insight as to what the exponent needs to be in order to preserve their integrity. You might be better off to keep them as-is, much like Stata's date-time variables are double-precision floating point values, yet can be relied upon to keep dates and times distinct within the design specifications of year range (I've forgotten, but it's some year in the distant past to some year in the distant future) and time precision of one millisecond.
Comment