Dear Statalisters,
I recently ran into a quite strange error when using an (old and awkward) ado file that was written for Stata 12. The point is: -merge- seems to evaluate a "1:1" constraint regardless of the -keep()- option in Stata 13, but did not so in Stata 12.
It took me a while to figure out what went wrong, but finally, here is a working example.
The point seems to be: the "1:1" constraint holds when only looking at the matched observations; thus, Stata 12 executes everything.
In Stata 13, however, the execution order seems to be different: the "1:1" part is checked on the whole data set, which must fail.
Questions: Is this change in -merge-
Bela
PS: I had this issue hanging around for quite some time. Only the new forum made me think again about posting it, just to try the new platform. Talking about this: Congratulations to all persons involved - it feels great.
I recently ran into a quite strange error when using an (old and awkward) ado file that was written for Stata 12. The point is: -merge- seems to evaluate a "1:1" constraint regardless of the -keep()- option in Stata 13, but did not so in Stata 12.
It took me a while to figure out what went wrong, but finally, here is a working example.
Code:
clear
tempfile using
// note this is a -long- file, but observations with
// -id-s 1 or 2 only occur uniquely
input id spell
1 1
2 1
7 1
7 2
7 3
8 1
8 2
8 3
end
save "`using'"
clear
// note this is a simple, cross-sectional file
// (one observation per id)
input id
1
2
end
// this -merge- works in Stata 12 (unexpectedly?)
// and does not in Stata 13 (as to be expected)
// it does neither work in Stata 13 prefixed by "version 12 : "
merge 1:1 id using "`using'" , keep(match)
In Stata 13, however, the execution order seems to be different: the "1:1" part is checked on the whole data set, which must fail.
Questions: Is this change in -merge-
- intended,
- documented somewhere and, more importantly,
- does it indicate a major overhaul in -merge- that may also have influences in other areas?
- Why does a "version 12" in Stata 13 not make -merge- behave as it had in Stata 12?
Bela
PS: I had this issue hanging around for quite some time. Only the new forum made me think again about posting it, just to try the new platform. Talking about this: Congratulations to all persons involved - it feels great.

Comment