I am dealing with bilateral pair data for the gravity model. The structure of my data is like
I need to identify the largest trading countries from the data, for which first I need to prepare country-wise total export (for example, total export for IND is the sum of rows 1 to 6) and then country-wise total import (for IND it is sum of row 1+2+9+10+15+16) finally I need to derive total trade (sum of export and import) for each country. Kindly suggest a way out. Thanks
| Sl.No. | exporter | importer | year | export |
| 1 | IND | IND | 2000 | 500 |
| 2 | IND | IND | 2001 | 600 |
| 3 | IND | AFG | 2000 | 100 |
| 4 | IND | AFG | 2001 | 200 |
| 5 | IND | USA | 2000 | 500 |
| 6 | IND | USA | 2001 | 700 |
| 7 | AFG | AFG | 2000 | 100 |
| 8 | AFG | AFG | 2001 | 150 |
| 9 | AFG | IND | 2000 | 20 |
| 10 | AFG | IND | 2001 | 40 |
| 11 | AFG | USA | 2000 | 15 |
| 12 | AFG | USA | 2001 | 20 |
| 13 | USA | USA | 2000 | 5000 |
| 14 | USA | USA | 2001 | 7000 |
| 15 | USA | IND | 2000 | 600 |
| 16 | USA | IND | 2001 | 800 |
| 17 | USA | AFG | 2000 | 50 |
| 18 | USA | AFG | 2001 | 80 |

Comment