Hi all,

I am sorry if I this may be a trivial question and if it has already been discussed. I searched through the forum but didn't find a solution.

I have bilateral data on migration and I would like to create a new variable in which the observation of Belgium and Luxembourg are summed, obtaining a "Belgium-Luxembourg" i_country (keeping all other countries and variables.

The sum (of Total, Male and Female) should be by year, destination country (j_*).

Could please someone give me some advice??

Hoping that I have made this clear, thank you in advance!
i_country i_code i_iso2 i_iso3 j_country j_code j_iso2 j_iso3 year Total Male Female
Luxembourg 442 LU LUX United Arab Emirates 784 AE ARE 2017
Belgium 56 BE BEL United Arab Emirates 784 AE ARE 2017
Belgium 56 BE BEL United Kingdom 826 GB GBR 2017 36822 16373 20449
Luxembourg 442 LU LUX United Kingdom 826 GB GBR 2017 1714 793 921
Belgium 56 BE BEL United Republic of Tanzania 834 TZ TZA 2017
Luxembourg 442 LU LUX United Republic of Tanzania 834 TZ TZA 2017
Belgium 56 BE BEL United States Virgin Islands 850 VI VIR 2017
Luxembourg 442 LU LUX United States Virgin Islands 850 VI VIR 2017
Belgium 56 BE BEL United States of America 840 US USA 2017 36310 17775 18535
Luxembourg 442 LU LUX United States of America 840 US USA 2017 2626 1290 1336
Belgium 56 BE BEL Uruguay 858 UY URY 2017
Luxembourg 442 LU LUX Uruguay 858 UY URY 2017