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, statalist.org is already up and running.


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

st: Problems with merge and updating missing data


From   "Newport-berra, Mchale" <mnewport@jhsph.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Problems with merge and updating missing data
Date   Tue, 6 Nov 2012 18:55:36 -0500

I am using Stata 11 and am trying to merge two datasets. One dataset consists of schools in 2002, and the other schools in 2004. The two datasets have the same variables, and I am matching on "ID."
The schools don't completely overlap (there are schools that are in the 2002 dataset but not the 2004 dataset and vice versa), but approximately half of the schools are in both datasets.  

I am using the 2002 dataset as the master, and want to use data from the 2004 to update missing variables in the 2002 dataset.  I have looked at the data, and have verified that there are variables for which the data is missing in 2002 but present in 2004.  However, when I try to do the merge with update missing, the "missing updated" is 0.  

merge 1:1 ID using "/Users/mchalenb/Desktop/October Dissertation Data/Nov2012 data/Fifth Grade Miss=..dta", update force
(label _1789F already defined)
(label SUPPRESS already defined)

    Result                           # of obs.
    -----------------------------------------
    not matched                         1,749
        from master                       758  (_merge==1)
        from using                        991  (_merge==2)

    matched                             1,124
        not updated                         0  (_merge==3)
        missing updated                     0  (_merge==4)
        nonmissing conflict             1,124  (_merge==5)
    -----------------------------------------


Does anyone have an idea about why this might be happening?
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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