Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


I rarely use the update option with the merge command and this time I
got an unexpected result. Below is an example of a 1 to many merge
with the variable x1 being missing in the master. I was expecting that
merged records would take the value of x1 from the using dataset but
that is not the case for id == 2. Does anyone understand what is


*--------------------------- begin example -----------------------
version 11

input id x1 seq
1 .  1
1 22 2
1 33 3
1 44 4
2 11 1
2 .  2
2 33 3
2 44 4

tempfile u
save "`u'"

input id x1
1 .
2 .

merge 1:m id using "`u'", update

sort id seq
list , noobs sepby(id)
*--------------------- end example --------------------------

On Wed, May 25, 2011 at 1:51 AM, laurendeason <> wrote:

>> Did you ever find out more about this? I have just encountered the same
>> problem, but what is really strange is that the problem only occurs when I
>> run my code on a version of Stata/MP 11.1 (on the linux cluster at my
>> University), while when I run identical code on the version of Stata I have
>> on my laptop (Stata/SE 11.1), it behaves differently (it behaves as one
>> would expect merge 1:m, update to behave).  I also ran the code you posted
>> on my version of Stata/SE 11.1, and indeed the merged records take the value
>> of x1 from the using dataset for all observations.
>> Does anyone know what's going on here?  Is there a problem with Stata/MP???
>> --
>> View this message in context:
>> Sent from the Statalist mailing list archive at

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index