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

Re: st: About mismatches in merge


From   "SJ Friederich, Economics" <[email protected]>
To   [email protected]
Subject   Re: st: About mismatches in merge
Date   Tue, 30 Mar 2004 23:56:06 +0100

--On 31 March 2004 <[email protected]> wrote:

I have been merging some files lately and discovered that _merge_
fails to match observations when the key-variables have different
precision.

If the key variable is measured as long in one file and float in the
other, most of my valid matches fail. _merge_ does tell me that the
key variable has been recast to a double, but I do feel that _merge_
should warn the user of potential false mismatches due to different
precision. If I make sure the key is stored as long in both files the
matches are correct.

I should mention that the key-variable I am using is a 9-digit
integer. I feel that this behaviour may be linked to the scale of the
key-variable.

In order to warn you of this, Stata would have to compare each of possibly millions of values in a dataset with it's representation under alternative storage types. If nothing else, it would probably be hugely demanding computationally. It's up to you to check that the variables used to match are stored with identical precision (and that, say, no processing step using other software could have altered the decimal precision of the variable in one of the files).

Sylvain


*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index