Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Convert Stock to panel of bilateral difference


From   Jonathan Stoeterau <[email protected]>
To   statalist <[email protected]>
Subject   st: Convert Stock to panel of bilateral difference
Date   Fri, 15 Oct 2010 12:37:27 +0900

Dear Statalist,

I would like to convert country-specific stocks
of a certain technology into a panel of bilateral
differences. Specifically, my data currently has
the following typical panel pattern:

country_name	year	value
Albania	1962	400
Albania	1963	430
Albania	1964	480
...
Algeria	1962	3200
Algeria	1963	3250
Algeria	1964	3300
...
Angola	1962 1200
Angola	1963 1000
Angola	1964 1300

and i would like to generate a panel that looks like:

country_name	year	country_name2 value
Albania	1962  Albania  400    //the original value
Albania	1962  Algeria  2800  //3200-400
Albania	1962  Angola  800   //1200-400
...
Albania	1963	 Algeria  2820 //3250-430
Albania	1962  Angola  570  //1000-430
...
...

I would appreciate any comment or idea.

Jonathan
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index