Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: merge on diff id vars
From
maarten buis <[email protected]>
To
[email protected]
Subject
Re: st: merge on diff id vars
Date
Thu, 5 May 2011 15:59:04 +0200
On Thu, May 5, 2011 at 3:31 PM, Argyn Kuketayev wrote:
> I have two data sets with keys PK and FK correspondingly. i want to
> merge them 1:1, except the key names are different in the dataset. i
> cant figure out if it's possible by reading the manual. any tips?
Just rename one of the keys, e.g.:
use dataset1
rename PK FK
tempfile foo
save `foo'
use dataset2
merge 1:1 FK using `foo'
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/