Hello,
I'm working with a dataset which includes information about 5 countries. In this case, I only want to work with 3 variables. The data looks like this:
reporter partner aux
Belgium Israel .0097238
Belgium Italy .0004703
Belgium Japan .0017738
Belgium Mexico .0038083
Israel Belgium .0058587
Israel Italy .0009222
Israel Japan .0017172
Israel Mexico .0051594
Where aux is the respective distance between each pair of countries by the GDP of each partner (say aux=Dij / GDPj).
So, I want to generate a new variable which shows the sum of these aux values for each combination of countries BUT without considering its respective aux value. Also it must be by reporter.
For example, the new variable should show in the first row (Belgium-Israel) the sum of .0004703+.0017738+.0038083 (these are the aux values of the other combination for Belgium, with italy, Japan and Mexico). Then, in the second row (Belgium-Italy) the sum of .0097238+.0017738+.0038083. Also, I want the same for Israel.
I hope you understand what I want.
Thanks!!
I'm working with a dataset which includes information about 5 countries. In this case, I only want to work with 3 variables. The data looks like this:
reporter partner aux
Belgium Israel .0097238
Belgium Italy .0004703
Belgium Japan .0017738
Belgium Mexico .0038083
Israel Belgium .0058587
Israel Italy .0009222
Israel Japan .0017172
Israel Mexico .0051594
Where aux is the respective distance between each pair of countries by the GDP of each partner (say aux=Dij / GDPj).
So, I want to generate a new variable which shows the sum of these aux values for each combination of countries BUT without considering its respective aux value. Also it must be by reporter.
For example, the new variable should show in the first row (Belgium-Israel) the sum of .0004703+.0017738+.0038083 (these are the aux values of the other combination for Belgium, with italy, Japan and Mexico). Then, in the second row (Belgium-Italy) the sum of .0097238+.0017738+.0038083. Also, I want the same for Israel.
I hope you understand what I want.
Thanks!!
Comment