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

Re: st: merge/joinby/append


From   "Philip Bejon" <[email protected]>
To   <[email protected]>, <[email protected]>
Subject   Re: st: merge/joinby/append
Date   Tue, 02 Mar 2004 18:38:39 +0300

try something like
joinby uniqueidvariable using "filename of other data set", unmatched (both)

this will join the data but then give you missing data wherever an observation is unique to one data set, and generate a variable called _merge to tell you whether the observation came from one or both data sets.

then repeat for your next data set. (remembering to rename or drop _merge - or it wont work)

Philip Bejon

>>> Federico Castillo <[email protected]> 03/02/04 06:26pm >>>
Hello Stata users:

I am trying to "merge" three data sets.  It is my understanding that merge
joins observations, append adds a data set to the end of the existing data
set and joinby forsm pairwise variables etc.  I do have a problem and that
is that while most of the observations in the three data sets are common to
all three there are a few that are not, hence, when I attempt to use append
(to add new variables to existing observations) some of the observations
are ignored in the resulting data set.  Is there a way to avoid this?
Should I pay special attetion to some particular detail? Like...name of
observations not being exactly teh same in all data sets? Acess to manuals
at this point is not possible since I am out of the country now.

Thanks in advance,

Federico

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


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