Statalist


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

Re: st: Match merge with message _merge=3 and _merge=5 ?


From   Svend Juul <SJ@SOCI.AU.DK>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Match merge with message _merge=3 and _merge=5 ?
Date   Mon, 10 Nov 2008 15:34:39 +0100

Pascal Stock wrote:

I have the problem that merging two datasets where the matches based  
in the identifier ought to merge, as the identifier is identical in  
the master and using dataset, some observations merge with _merge=3  
and others with _merge=5 do not.

What could be the problem that the master data is disagreeing
(_merge=5)?

======================================================================

-help merge- tells that _merge=5 occurs with the -update- option
when there is a discrepancy between a nonmissing value in the
master dataset and the value in the using dataset. [D] merge 
has this example:

    . webuse updates
    . save updates
    . webuse original
    . merge make using updates, update

    . list, clean

           make             price   mpg   displa~t   _merge  
      1.   Chev. Chevette   3,299    29        231        3  
      2.   Chev. Malibu     4,504    22        200        4  
      3.   Datsun 510       5,079    24        119        3  
      4.   Merc. XR-7       6,303    14        302        4  
      5.   Olds Cutlass     4,733    19        231        3  
      6.   Renault Le Car   3,895    26         79        5  
      7.   VW Dasher        7,140    23         97        3  

In the sixth observation, -mpg- was 26 in the master dataset and
25 in the using dataset, and that is what -merge=5 tells you.

Hope this helps
Svend


__________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone:  +45 8942 6090
Home:   +45 8693 7796
Email:  sj@soci.au.dk
__________________________________________ 

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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