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

RE: st: RE: matching data


From   "Nick Winter" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: matching data
Date   Tue, 8 Apr 2003 10:59:12 -0400

> -----Original Message-----
> From: Reka Sundaram-Stukel [mailto:[email protected]] 
> Sent: Tuesday, April 08, 2003 10:49 AM
> To: [email protected]
> Subject: Re: st: RE: matching data
> 
> 
> Nick
> 
> Thank you.
> 
> The problem is with the order of the data. N1 in <<dataset 1>> equals 
> N3 in <<dataset2>>.
> 
> Reka

In that case, just rename the variables in one of the datasets before
you start.

Nick Winter

> 
> 
> On Tuesday, April 8, 2003, at 09:14 AM, Nick Winter wrote:
> 
> > Why does -merge- not work for you?  I would think:
> >
> > 	. use <<dataset2>>
> > 	. sort N1 N2 N3
> > 	. save, replace
> > 	. use <<dataset1>>
> > 	. sort N1 N2 N3
> > 	. merge N1 N2 N3 using <<dataset2>> , nokeep
> > 	. generate check=(_merge==3)
> >
> > (The last line simply creates the check variable, based on 
> whether or
> > not there was a successful merge.)
> >
> > Nick WInter

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