First, add whatever country codes are needed to the SGR data: there are routines for both Stata (kountry; type findit kountry
in Stata’s command window to install) and R (countrycode, on CRAN) to generate many commonly used country codes. Then follow the instructions for merging data into the SGR found in the “stata_sgr.pdf” or “R_sgr.pdf” files included in the data download.