I want to try calculate a score or create an index that gives the degree of states "marginalization" within a world economy. In other words, an index that would indicate state's position within the world economy.
Basically, I try to replicate someone else's indicator. He defined "marginalization" within the World Economy as a function of that country's percentage of world trade.
It was computed by calculating: the total imports + total exports of a given nation divided by the total imports + exports of the world economy. The inverse of that divided by 100.
I am trying to figure out how to calculate this in R, using my data. Below I give an (real) example.
Country Year EXPORT(%GDP) IMPORT(%GDP) GDP(current$)
A 2001 22,14 21,96 3,78(+11)
B 2001 35,43 31,80 5387293(..)
C 2001 27,22 30,84 1,90
WORLD 2001 24,43 24,20 3,30(+13)
To be clear, I want to calculate a score for each country and year in my data (about 150 countries, from 1990 to 2014). The equation is (to be clear, again): import + export (for a given country in the dataset) / import + export (of the world economy, please see the variable "WORLD" in the example.
EDIT: another example with current $ (if this is of any help)
Country Year EXPORT(current$) IMPORT(c$) GDP(c$)
A 2001 8,38177(..) 8,31506 3,78(+11)
B 2001 1,90875(..) 1,71328 5,387293(..)
C 2001 5,1872(..) 5,87710 1,90
WORLD 2001 7,6811(..) 7,7101 3,30(+13)