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: Merge Datasets with Two Variables


From   Lisa Wang <lhwang0925@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Merge Datasets with Two Variables
Date   Sat, 11 Aug 2012 22:32:53 +1000

Hi all,

Please provide some help on my problem. I'll describe how I would do
it in Excel, as that is the data program I am most familiar with.

I have two data sets: 1. FC and 2. SIR. The "FC" data set is where I
want the additional columns to be added to. The "SIR" has the data
that I want added to "FC".

In "FC", I have two date variables 'cdate' and 'edate' that I would
like STATA to vlookup the appropriate price value variable 'high' in
my "SIR" file for those two particular dates by each observation/row
"id" and add this as two new columns at the end of my "FC" data file.
The 'cdate', 'edate' and 'high' are all unique, if that makes a
difference.

In Excel, I would select the cell with the "id" and then do a vlookup
for an matrix in the "SIR" file.

Appreciate any suggestions or I will provide further information if necessary.

Thank you for your considerations,
Lisa
*
*   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/


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