Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: merging datasets


From   "Achilleas Vassilopoulos" <vassilopoulos.statalist@gmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: merging datasets
Date   Tue, 20 Nov 2012 10:17:54 +0200

Hi Nick,

Not sure I get your point. My guess is that there are variables(columns) in
B that are not present in A. Is that right?
If this is the case, you need:

merge 1:1 id using "B", keepusing (the list of variables that are present in
B but not in A)

Hope this helps,
Achilleas

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nikolaos Pandis
Sent: Tuesday, November 20, 2012 9:43 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: merging datasets

Dear all,

I would appreciate any help on the following:

I have 2 datasets A (~150 observations) and B (~45 observations)
B is included in A and share some common fields including observation id
(num)
It should have been one dataset but unfortunately it is not and I would like
to merge them.
Dataset B has all the fields of A but some extra ones.
Q: is there a way to append the extra fields (for the eligible
observations) from dataset B to dataset A using observation id as the link?

many thanks  

Nick

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index