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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: Merging dyadic panel data


From   Sam Gluck <gluckster500@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Merging dyadic panel data
Date   Mon, 5 Dec 2011 15:14:10 +0000

Dear Statalisters, I have what I suspect is a real monster of a
problem, and I don't really know where to start.


I have two datasets on international trade, both country-pair X time
datasets in long form. Dataset1 looks like:

Unique_country-pair_ID     country1_name    country2_name   year
bilattrade   indepvars

bilattrade is a an average of import and export flows between the two
countries, so there's only a single observation on each country-pair
for a given year.


Dataset2 contains observations on an (almost identical) set of
countries over an (almost identical) time period. It looks like this:

Importer_country    exporter_country     year    trade_value

The difference here is that dataset2 splits the trade between a
country pair in a given year into two observations - (exports from i
to j) and (imports to i from j)

What I wish to do is take the indepvars from dataset1 and combine them
with the disaggregated trade value data from dataset2.

What seems obvious is that I need to somehow get the unique pair-IDs
into the second data set. There are over 12,000 unique observations on
that particular variable, however.

The other problem is, of course, that the countries in either dataset
are not exactly the same and that I need to drop those countries that
do not appear in both data sets in the same years. Is there some stata
command that would help with this?

Any help would be greatly appreciated...

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