Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Data Merge Question


From   "Sergiy Radyakin" <[email protected]>
To   [email protected]
Subject   Re: st: Data Merge Question
Date   Thu, 31 Jan 2008 20:01:13 -0500

Hello David,

the option uniquemaster tells Stata that the observations in memory
are uniquely identified by the key variables you specify (var1 var2
var3). In your case they are not. So just do not specify this option.
You will get a warning, but the merge must be ok. Then check the
_merge variable if it makes sence.

Best,
   Sergiy




On 1/31/08, Lektzian, David <[email protected]> wrote:
> Dear Statalist,
> I am trying to merge together two datasets that look something like
> this:
>
> Data in memory
> var1  var2  var3 [additional variables]
>
> Using Data:
> var1 var2 var3 [additional variables that I want to add to the data in
> memory]
>
> The problem I'm having is that the data in memory is not unique on these
> three variables, but the using data is.  I do not mind that the data in
> memory is not unique on these variables, because there is a fourth
> variable in the data in memory that makes them unique.  But this
> variable is not part of the using data.  I just want to merge in
> additional variables from the using data so that they can be added to
> the data in the memory.  I don't mind that the observations are repeated
> in the data.  After the merge I just want to have the same number of
> observations that I began with in the data in memory.  Here is what I
> tried and the result:
>
> .merge var1 var2 var3 using "C:\Data.dta", uniqmaster nokeep
>
> variables var1 var2 var3 do not uniquely identify observations in the
> master data
>
> I'm sure that I am overlooking something very simple.  Any help would be
> appreciated.
>
> Thanks,
> David
>
>
>
> *
> *   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