Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: merge m:1 by string


From   "Ben Ammar" <[email protected]>
To   [email protected]
Subject   st: merge m:1 by string
Date   Fri, 18 Mar 2011 23:21:29 +0100

Hi everybody,

I've got a problem concerning the merge-command or rather the result of it.
I'd be very grateful for any help. There are more than 2 million names (%str32) in my master and 4000 names(%str32) in my using concerning the variable (name) I want to merge on. Since there are multiple observations with the same name in my master but only one unique observation in the using, the m:1 merge command supposed to be correct. 

master: 
name               household1    date

Alex T. Smith         45          1988
Alex T. Smith         33          1977 
Andrew J. williams    12          1999
Andrew J. Williams    12          2004
Steve R. Jackson      23          1979


using:
name                 budget

Alex T. Smith         130
Andrew J. Williams    345
Steve R. Jackson      245


but what happens is that the using is appended at the end of the master after the merger. I think the problem here is the string variable even though I don't understand why. When I encoded the string variable (name) about 8000 observations (out of 2 million) in the master where matched just like it should be but unfortunately not yet enough. The format of the var in both data sets is the same and I even sorted them. I also checked if there's a space at the beginning of the name or if there's anything within the string that differs from the using-name but both string-variables are exactly the same. Last (unlikely) case I checked was the RAM by dropping all other variables which could have taken too much memory and therefore explain why a very little part was matched when trying to encode the string. That didn't work either. Does anyone have an idea on that or even made the same experience? Thanks for any comments!

Regards
Ben


-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!			
Jetzt informieren: http://www.gmx.net/de/go/freephone
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index