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

st: RE: merge...


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: merge...
Date   Tue, 2 Jul 2002 09:33:36 +0100

Riano, Alejandro
>
> Dear Statalisters, i have two databases, the first one has monthly data by
> country like this:
>
> country      year    month    var1
> Argentina   1989      1          x
> Argentina   1989      2          x
>       .             .         .           .
>       .             .         .           .
> Argentina   1999      12        x
>
>
> for some set of countries (103 in total) and i have a second
> database which
> has all the bilateral combinations among the countries that are
> included in
> the first database (on a YEARLY basis), like this:
>
>
> country1       country2          year      var2
> Argentina      Brazil              1989       x
> Argentina      Brazil              1990       x
>       .                .                      .         .
>       .                .                      .         .
> Zambia         Zimbabwe        1999       x
>
> My problem is that i want to merge the var1 of the first database into the
> second one and in that way trasform my second bilateral base from a yearly
> frecuency to a monthly one. Do you have any idea about how could
> i do this ?
>

You could try a -merge- using country and year
variables. It sounds as if you want to merge using
-country1 year- in the first data set and -country year-
in the second, so you need to do a -rename- first.

The -merge- will possibly be cleaner if you -expand-
the second data set to monthly first.

Nick
[email protected]

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