I have the following dataset:
I would like to manipulate it so it's reshaped in a bilateral manner like this:
Iso1 iso2 year Agreement No. of provisions
CO PA 2002 Colombia Panama 66
PA CO 2002 Colombia Panama 66
Do you have any idea how I can do so?
I would greatly appreciate your help on this.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str65 AGREEMENTS int(Year NOPROVISIONS) str2(country1 country2 country3 country4 country5 country6 country7 country8 country9 country10) "Colombia Panama" 2002 66 "CO" "PA" "" "" "" "" "" "" "" "" "" 2002 38 "CO" "US" "" "" "" "" "" "" "" "" "Colombia Northern Triangle" 2002 24 "CO" "GT" "HN" "SV" "" "" "" "" "" "" "Colombia MERCOSUR services" 2002 14 "AR" "BR" "CO" "PY" "UY" "VE" "" "" "" "" "Colombia MERCOSUR" 2002 9 "AR" "BR" "CO" "PY" "UY" "VE" "" "" "" "" "Andean Countries MERCOSUR" 2002 7 "AR" "BR" "CO" "EC" "PY" "UY" "VE" "" "" "" "Andean Community Auto Agreement" 2002 4 "CO" "EC" "VE" "" "" "" "" "" "" "" "Colombia Cuba" 2002 4 "CO" "CU" "" "" "" "" "" "" "" "" "Mexico Northern Triangle" 2002 45 "GT" "HN" "MX" "SV" "" "" "" "" "" "" "Mexico Nicaragua" 2002 37 "MX" "NI" "" "" "" "" "" "" "" "" "Mexico Panama" 2002 23 "MX" "PA" "" "" "" "" "" "" "" "" "Mexico Uruguay" 2002 22 "MX" "UY" "" "" "" "" "" "" "" "" "Israel Mexico" 2002 11 "IL" "MX" "" "" "" "" "" "" "" "" "Guatemala Mexico" 2002 8 "GT" "MX" "" "" "" "" "" "" "" "" "EU Mexico" 2002 6 "MX" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Brazil Mexico" 2002 5 "BR" "MX" "" "" "" "" "" "" "" "" "Cuba Mexico" 2002 3 "CU" "MX" "" "" "" "" "" "" "" "" "MERCOSUR Mexico Auto Agreement" 2002 2 "AR" "BR" "MX" "PY" "UY" "" "" "" "" "" "MERCOSUR Mexico" 2002 1 "AR" "BR" "MX" "PY" "UY" "VE" "" "" "" "" "Panama US" 2002 83 "PA" "US" "" "" "" "" "" "" "" "" "Panama Taiwan" 2002 37 "PA" "TW" "" "" "" "" "" "" "" "" "" 2002 36 "PA" "US" "" "" "" "" "" "" "" "" "Panama Trinidad Tobago" 2002 11 "PA" "TT" "" "" "" "" "" "" "" "" "Nicaragua Panama Protocol" 2002 1 "NI" "PA" "" "" "" "" "" "" "" "" "Central European Free Trade Agreement (CEFTA) Croatia accession" 2002 0 "" "" "" "" "" "" "" "" "" "" "Australia US" 2003 73 "AU" "US" "" "" "" "" "" "" "" "" "Australia Malaysia" 2003 30 "AU" "MY" "" "" "" "" "" "" "" "" "Australia China" 2003 21 "AU" "CN" "" "" "" "" "" "" "" "" "Australia Thailand" 2003 12 "AU" "TH" "" "" "" "" "" "" "" "" "Oman US" 2003 75 "OM" "US" "" "" "" "" "" "" "" "" "Morocco US" 2003 66 "MA" "US" "" "" "" "" "" "" "" "" "Bahrain US" 2003 58 "BH" "US" "" "" "" "" "" "" "" "" "Jordan US" 2003 30 "JO" "US" "" "" "" "" "" "" "" "" "United States Vietnam" 2003 7 "US" "VN" "" "" "" "" "" "" "" "" "Laos US" 2003 6 "LA" "US" "" "" "" "" "" "" "" "" "Armenia EC" 2003 122 "AM" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Vietnam" 2003 122 "VN" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Moldova" 2003 120 "MD" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Ukraine" 2003 116 "UA" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Georgia" 2003 101 "GE" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Singapore" 2003 84 "DZ" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "CARIFORUM EU EPA" 2003 84 "AG" "BB" "BS" "BZ" "DM" "DO" "GD" "GY" "JM" "KN" "EC Kazakhstan" 2003 81 "KZ" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EC EAC" 2003 61 "BI" "KE" "RW" "SS" "TZ" "UG" "DE" "FR" "IT" "NL" "EU Latvia Europe Agreement" 2003 57 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "EU Lithuania Europe Agreement" 2003 52 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "EU Estonia Europe Agreement" 2003 50 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "EU Slovenia Europe Agreement" 2003 50 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Cotonou Agreement" 2003 48 "AG" "AO" "BB" "BF" "BI" "BJ" "BS" "BW" "BZ" "CD" "EC SADC" 2003 39 "BW" "LS" "MZ" "NA" "SZ" "ZA" "DE" "FR" "IT" "NL" "Common Economic Zone" 2003 0 "" "" "" "" "" "" "" "" "" "" "EC Nice (25) Enlargement" 2003 0 "" "" "" "" "" "" "" "" "" "" "Argentina Uruguay" 2003 0 "" "" "" "" "" "" "" "" "" "" "Jordan Sudan" 2003 0 "" "" "" "" "" "" "" "" "" "" "EU Amsterdam" 2004 39 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "EU South Africa" 2004 37 "ZA" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Nice" 2004 37 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "EC West African states" 2004 36 "BF" "BJ" "CI" "CV" "GH" "GM" "GN" "GW" "LR" "ML" "EU Macedonia SAA" 2004 36 "MK" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EC Montenegro SAA" 2004 35 "ME" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Serbia SAA" 2004 32 "RS" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Bosnia and Herzegovina EU SAA" 2004 30 "BA" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Algeria EU Euro-Med Association Agreement" 2004 25 "DZ" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Lebanon Euro-Med Association Agreement" 2004 25 "LB" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Egypt Euro-Med Association Agreement" 2004 20 "EG" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Cote d'Ivoire EU EPA" 2004 18 "CI" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Lisbon" 2004 17 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Albania EU SAA" 2004 17 "AL" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Israel Euro-Med Association Agreement" 2004 16 "IL" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Jordan Euro-Med Association Agreement" 2004 16 "JO" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Nice (27) Enlargement" 2004 13 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "EU Morocco Euro-Med Association Agreement" 2004 13 "MA" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "EU Tunisia Euro-Med Association Agreement" 2004 13 "TN" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Bulgaria Estonia" 2004 11 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Romania Serbia" 2004 11 "RS" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Albania Romania" 2004 10 "AL" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Macedonia Romania" 2004 10 "MK" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Bulgaria Lithuania" 2004 10 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Bulgaria Moldova" 2004 9 "MD" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Group of Three Auto Agreement" 2004 0 "" "" "" "" "" "" "" "" "" "" "Bulgaria Macedonia" 2005 9 "MK" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Baltic Free Trade Area (BAFTA) Non Tariff Barriers" 2005 9 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Bosnia and Herzegovina Croatia" 2005 8 "BA" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Bosnia and Herzegovina Romania" 2005 8 "BA" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Bulgaria Serbia" 2005 8 "RS" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Bulgaria Latvia" 2005 8 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Central European Free Trade Agreement (CEFTA)" 2005 8 "AL" "BA" "MD" "ME" "MK" "RS" "XK" "DE" "FR" "IT" "Hungary Latvia" 2005 8 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Bosnia and Herzegovina Bulgaria" 2005 8 "BA" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Albania Bulgaria" 2005 7 "AL" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Hungary Lithuania" 2005 7 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Estonia Slovenia" 2005 7 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Albania Croatia" 2005 7 "AL" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Bosnia and Herzegovina Slovenia" 2005 7 "BA" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Bulgaria Israel" 2005 7 "IL" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Estonia Hungary" 2005 7 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Brazil Suriname" 2005 0 "" "" "" "" "" "" "" "" "" "" "Croatia Slovenia" 2006 6 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" "Poland Turkey" 2006 6 "TR" "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "Lithuania Slovenia" 2006 6 "DE" "FR" "IT" "NL" "BE" "LU" "DK" "IE" "GB" "GR" end
Iso1 iso2 year Agreement No. of provisions
CO PA 2002 Colombia Panama 66
PA CO 2002 Colombia Panama 66
Do you have any idea how I can do so?
I would greatly appreciate your help on this.
Comment