Dear all,
I am currently working with a country-year (several countries for the period 1991-2017) panel dataset which contains data for the variable p. The dataset looks as follows:
I would like to do something simple, namely divide the value for p of each country by the value for p of a numeraire country for a specific year, in this case that is the U.S.A for the year 1991. Thus, each observation for the variable p must be divided by one specific observation, namely the value for p when iso3code= USA and year=1991.
I cannot seem to find a code that does this for me. Any help on this is greatly appreciated.
Best,
Satya
I am currently working with a country-year (several countries for the period 1991-2017) panel dataset which contains data for the variable p. The dataset looks as follows:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str3 iso3code int year float p "AFG" 1991 .26324314 "AGO" 1991 .07728866 "ALB" 1991 .16126928 "ARE" 1991 .07935231 "ARG" 1991 .10957538 "AUS" 1991 .12007634 "AUT" 1991 .15538613 "BDI" 1991 .1682758 "BGD" 1991 .0887369 "BGR" 1991 .21465053 "BOL" 1991 .08842834 "BRA" 1991 .062516764 "BTN" 1991 .07286633 "BWA" 1991 .07766687 "CAN" 1991 .18250223 "CHE" 1991 .17977367 "CHL" 1991 .17008154 "CHN" 1991 .13463156 "CMR" 1991 .05731851 "COD" 1991 .07688629 "COL" 1991 .0827645 "CYP" 1991 .0847219 "DEU" 1991 .14722322 "DNK" 1991 .1661195 "DZA" 1991 .2676517 "ECU" 1991 .07355322 "EGY" 1991 .16315214 "ESP" 1991 .13816103 "FIN" 1991 .15071706 "FRA" 1991 .20819467 "GBR" 1991 .2048492 "GRC" 1991 .1799765 "GTM" 1991 .06381295 "HND" 1991 .06313922 "HUN" 1991 .11392532 "IND" 1991 .18820088 "IRL" 1991 .09506503 "IRN" 1991 .2333436 "IRQ" 1991 .2749146 "ISR" 1991 .08214688 "ITA" 1991 .15988086 "JOR" 1991 .10949718 "JPN" 1991 .12740448 "KEN" 1991 .09040132 "KOR" 1991 .09588184 "KWT" 1991 .07757444 "LBN" 1991 .08384028 "LBY" 1991 .12150127 "LSO" 1991 .0899893 "MAR" 1991 .3298471 "MDG" 1991 .07864311 "MEX" 1991 .1063788 "MLI" 1991 .07417072 "MLT" 1991 .11386012 "MMR" 1991 .06519765 "MNG" 1991 .12883416 "MOZ" 1991 .07243199 "MRT" 1991 .07706072 "MWI" 1991 .07670119 "NAM" 1991 .0788064 "NCL" 1991 .06329099 "NER" 1991 .093072 "NGA" 1991 .09590288 "NLD" 1991 .08545596 "NOR" 1991 .14657421 "NPL" 1991 .11307379 "NZL" 1991 .07793946 "OMN" 1991 .07882214 "PAK" 1991 .2136493 "PER" 1991 .0902002 "POL" 1991 .10701688 "PRK" 1991 .06605012 "PRT" 1991 .12656064 "PRY" 1991 .08081456 "PSE" 1991 . "QAT" 1991 .0965965 "ROU" 1991 .15691066 "RWA" 1991 .08875785 "SAU" 1991 .3373662 "SOM" 1991 .07675452 "SWE" 1991 .14027049 "SWZ" 1991 .0770141 "SYR" 1991 .23945548 "TCD" 1991 .07753914 "THA" 1991 .06408442 "TUN" 1991 .3140195 "TUR" 1991 .18619636 "TWN" 1991 .06229275 "TZA" 1991 .08104041 "UGA" 1991 .07718216 "URY" 1991 .08086365 "USA" 1991 .09329012 "VEN" 1991 .06689537 "YEM" 1991 .10683016 "ZAF" 1991 .13975191 "ZMB" 1991 .09120012 "ZWE" 1991 .1167359 "AFG" 1992 .24156703 "AGO" 1992 .06865555 "ALB" 1992 .14868183 "ARE" 1992 .07002092 "ARG" 1992 .10474285 "ARM" 1992 .11770034 "AUS" 1992 .2012137 "AUT" 1992 .14467098 "AZE" 1992 .1654236 "BDI" 1992 .14846717 "BGD" 1992 .0888667 "BGR" 1992 .20970023 "BIH" 1992 .1588485 "BLR" 1992 .07767703 "BOL" 1992 .08009361 "BRA" 1992 .06287865 "BTN" 1992 .06487154 "BWA" 1992 .06817044 "CAN" 1992 .1454488 "CHE" 1992 .1738271 "CHL" 1992 .15844306 "CHN" 1992 .1382531 "CMR" 1992 .05908934 "COD" 1992 .0681892 "COL" 1992 .068500444 "CYP" 1992 .07864647 "DEU" 1992 .1561983 "DNK" 1992 .1711161 "DZA" 1992 .3448201 "ECU" 1992 .06423723 "EGY" 1992 .1562376 "ESP" 1992 .12005354 "EST" 1992 .14839287 "FIN" 1992 .11015483 "FRA" 1992 .20277137 "GBR" 1992 .20375232 "GEO" 1992 .11114666 "GRC" 1992 .14920314 "GTM" 1992 .05865807 "HND" 1992 .05796011 "HRV" 1992 .2229043 "HUN" 1992 .10576737 "IND" 1992 .17048697 "IRL" 1992 .08708007 "IRN" 1992 .21193446 "IRQ" 1992 .19460054 "ISR" 1992 .080836 "ITA" 1992 .14190578 "JOR" 1992 .09652802 "JPN" 1992 .11426197 "KAZ" 1992 .35702685 "KEN" 1992 .06940021 "KGZ" 1992 .1524303 end
I cannot seem to find a code that does this for me. Any help on this is greatly appreciated.
Best,
Satya
Comment