Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: Requirement(s) for a match merge


From   "louis boakye-yiadom" <[email protected]>
To   [email protected]
Subject   RE: st: RE: Requirement(s) for a match merge
Date   Wed, 30 Mar 2005 17:55:12 +0000

Thank you, Nick.


From: "Nick Cox" <[email protected]>

I see what you are getting at.

-father- is irrelevant to the -merge-. You
can merge on -id- without problems with this
example.

Nick
[email protected]

louis boakye-yiadom

> Perhaps an example will clarify my concern. Suppose we have
> the following
> datasets, where -id- (the identifier) represents family code:
> Dataset1
>       id   father
> 1.   1    John
> 2.   2    Peter
> 3.   3    Sam
>
> Dataset2
>      id  child
> 1.  1   Bill
> 2.  2   Joe
> 3.  2   Mary
> 4.  3   Phil
> 5.  3   Sue
> 6.  3   Pat
>
> I was thinking that even though -id- does not uniquely identify each
> observation in dataset 2, the datasets can still be merged
> using -id- as the
> match variable to obtain a result like the following:
>
>      id   father child
> 1.  1    John   Bill
> 2.  2    Peter  Joe
> 3.  2    Peter  Mary
> 4.  3    Sam    Phil
> 5.  3    Sam    Sue
> 6.  3    Sam    Pat
>
> Or is it that this kind of merge is not called match merge? Thanks.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index