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

Re: st: Expanding dataset


From   "Dev Vencappa" <[email protected]>
To   <[email protected]>
Subject   Re: st: Expanding dataset
Date   Sat, 14 Feb 2004 21:28:56 +0000

>>> [email protected] 02/14/04 09:08pm >>>
On Sat, 14 Feb 2004, R.E. De Hoyos wrote:

>
> I have a dataset with bilateral trade data as follows:
>
> Country1  Country2     year         btrade
> US            Arg            1950         x1
> US            Arg            1951         x2
> US            Bra            1949         x3
> US            Can            1949        x4
> US            Can            1950        x5
> US            Can            1951        x6
> US            Col             1950        x7
> US            Chile           1950        x9
> US            Mex            1950        x10
> Arg            Bra             1950        x11
> Arg            Can            1951        x12
>
Stephen replied to this. Let me expand on it a bit. Basically what Stephen is suggesting is to have the same dataset stored in a second file. This second data set will however have country 2 renamed to country 1 and vice versa. Then a joinby command on the two datasets should do the job. The joinby variables would be country 1 and year. If you want to be sure whether joinby is doing it right, you might want to add the unm(both) option in the joinby command, just to see if this is you are getting what you want. I think this is correct.

Dev




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