Statalist


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

Re: st: merge not full identified datasets


From   Neil Shephard <nshephard@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: merge not full identified datasets
Date   Tue, 28 Jul 2009 13:04:57 +0100

On Tue, Jul 28, 2009 at 12:43 PM, Martin Baumgarten<Pandaros@gmx.de> wrote:
> Hello all,
>
> I try to merge two datasets [merge partner year using "E:\....dta", unique sort] of the following kind
>
> Set1
> Reporter        Partner   Year   Value
> 1               A         1992
> 1               B         1992
> 1               A         1993
> 1               B         1993
> 2               A         1992
> 2               B         1992
> 2               A         1993
> 2               B         1993
>
> Set2
> Partner  Year   Index
> A        1992
> B        1993
>
>
>
> What I want to do is to link the entries of Index from  Set2 to each respective partner in Set1 and that for each year.
> However, Stata does not want to because “partner” does not identify  Set1 and there are multiple entries for the same year and partner. But even if I use “one-to-many key variables” Stata still does not connect some of the observations.

Perhaps consider using -joinby- instead.

Neil

-- 
"The combination of some data and an aching desire for an answer does
not ensure that a reasonable answer can be extracted from a given body
of data." ~ John Tukey (1986), "Sunset salvo". The American
Statistician 40(1).

Email - nshephard@gmail.com
Website - http://slack.ser.man.ac.uk/
Photos - http://www.flickr.com/photos/slackline/

*
*   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