*! _region <3 Mar 2019 : 20:52:10>                 by João Pedro Azevedo
*                 auto generated and updated using _update_countrymetadata.ado

 program define _region

     syntax , match(varname)

*********************

         gen region = ""
         replace region = "LCN"  if `match' == "ABW"
         replace region = "SAS"  if `match' == "AFG"
         replace region = "NA"  if `match' == "AFR"
         replace region = "SSF"  if `match' == "AGO"
         replace region = "ECS"  if `match' == "ALB"
         replace region = "ECS"  if `match' == "AND"
         replace region = "NA"  if `match' == "ANR"
         replace region = "NA"  if `match' == "ARB"
         replace region = "MEA"  if `match' == "ARE"
         replace region = "LCN"  if `match' == "ARG"
         replace region = "ECS"  if `match' == "ARM"
         replace region = "EAS"  if `match' == "ASM"
         replace region = "LCN"  if `match' == "ATG"
         replace region = "EAS"  if `match' == "AUS"
         replace region = "ECS"  if `match' == "AUT"
         replace region = "ECS"  if `match' == "AZE"
         replace region = "SSF"  if `match' == "BDI"
         replace region = "NA"  if `match' == "BEA"
         replace region = "NA"  if `match' == "BEC"
         replace region = "ECS"  if `match' == "BEL"
         replace region = "SSF"  if `match' == "BEN"
         replace region = "SSF"  if `match' == "BFA"
         replace region = "SAS"  if `match' == "BGD"
         replace region = "ECS"  if `match' == "BGR"
         replace region = "NA"  if `match' == "BHI"
         replace region = "MEA"  if `match' == "BHR"
         replace region = "LCN"  if `match' == "BHS"
         replace region = "ECS"  if `match' == "BIH"
         replace region = "NA"  if `match' == "BLA"
         replace region = "ECS"  if `match' == "BLR"
         replace region = "LCN"  if `match' == "BLZ"
         replace region = "NA"  if `match' == "BMN"
         replace region = "NAC"  if `match' == "BMU"
         replace region = "LCN"  if `match' == "BOL"
         replace region = "LCN"  if `match' == "BRA"
         replace region = "LCN"  if `match' == "BRB"
         replace region = "EAS"  if `match' == "BRN"
         replace region = "NA"  if `match' == "BSS"
         replace region = "SAS"  if `match' == "BTN"
         replace region = "SSF"  if `match' == "BWA"
         replace region = "NA"  if `match' == "CAA"
         replace region = "SSF"  if `match' == "CAF"
         replace region = "NAC"  if `match' == "CAN"
         replace region = "NA"  if `match' == "CEA"
         replace region = "NA"  if `match' == "CEB"
         replace region = "NA"  if `match' == "CEU"
         replace region = "ECS"  if `match' == "CHE"
         replace region = "ECS"  if `match' == "CHI"
         replace region = "LCN"  if `match' == "CHL"
         replace region = "EAS"  if `match' == "CHN"
         replace region = "SSF"  if `match' == "CIV"
         replace region = "NA"  if `match' == "CLA"
         replace region = "NA"  if `match' == "CME"
         replace region = "SSF"  if `match' == "CMR"
         replace region = "SSF"  if `match' == "COD"
         replace region = "SSF"  if `match' == "COG"
         replace region = "LCN"  if `match' == "COL"
         replace region = "SSF"  if `match' == "COM"
         replace region = "SSF"  if `match' == "CPV"
         replace region = "LCN"  if `match' == "CRI"
         replace region = "NA"  if `match' == "CSA"
         replace region = "NA"  if `match' == "CSS"
         replace region = "LCN"  if `match' == "CUB"
         replace region = "LCN"  if `match' == "CUW"
         replace region = "LCN"  if `match' == "CYM"
         replace region = "ECS"  if `match' == "CYP"
         replace region = "ECS"  if `match' == "CZE"
         replace region = "NA"  if `match' == "DEA"
         replace region = "NA"  if `match' == "DEC"
         replace region = "ECS"  if `match' == "DEU"
         replace region = "NA"  if `match' == "DFS"
         replace region = "MEA"  if `match' == "DJI"
         replace region = "NA"  if `match' == "DLA"
         replace region = "LCN"  if `match' == "DMA"
         replace region = "NA"  if `match' == "DMN"
         replace region = "NA"  if `match' == "DNF"
         replace region = "ECS"  if `match' == "DNK"
         replace region = "NA"  if `match' == "DNS"
         replace region = "LCN"  if `match' == "DOM"
         replace region = "NA"  if `match' == "DSA"
         replace region = "NA"  if `match' == "DSF"
         replace region = "NA"  if `match' == "DSS"
         replace region = "NA"  if `match' == "DXS"
         replace region = "MEA"  if `match' == "DZA"
         replace region = "NA"  if `match' == "EAP"
         replace region = "NA"  if `match' == "EAR"
         replace region = "NA"  if `match' == "EAS"
         replace region = "NA"  if `match' == "ECA"
         replace region = "NA"  if `match' == "ECS"
         replace region = "LCN"  if `match' == "ECU"
         replace region = "MEA"  if `match' == "EGY"
         replace region = "NA"  if `match' == "EMU"
         replace region = "SSF"  if `match' == "ERI"
         replace region = "ECS"  if `match' == "ESP"
         replace region = "ECS"  if `match' == "EST"
         replace region = "SSF"  if `match' == "ETH"
         replace region = "NA"  if `match' == "EUU"
         replace region = "NA"  if `match' == "FCS"
         replace region = "ECS"  if `match' == "FIN"
         replace region = "EAS"  if `match' == "FJI"
         replace region = "ECS"  if `match' == "FRA"
         replace region = "ECS"  if `match' == "FRO"
         replace region = "EAS"  if `match' == "FSM"
         replace region = "NA"  if `match' == "FXS"
         replace region = "SSF"  if `match' == "GAB"
         replace region = "ECS"  if `match' == "GBR"
         replace region = "ECS"  if `match' == "GEO"
         replace region = "SSF"  if `match' == "GHA"
         replace region = "ECS"  if `match' == "GIB"
         replace region = "SSF"  if `match' == "GIN"
         replace region = "SSF"  if `match' == "GMB"
         replace region = "SSF"  if `match' == "GNB"
         replace region = "SSF"  if `match' == "GNQ"
         replace region = "ECS"  if `match' == "GRC"
         replace region = "LCN"  if `match' == "GRD"
         replace region = "ECS"  if `match' == "GRL"
         replace region = "LCN"  if `match' == "GTM"
         replace region = "EAS"  if `match' == "GUM"
         replace region = "LCN"  if `match' == "GUY"
         replace region = "NA"  if `match' == "HIC"
         replace region = "EAS"  if `match' == "HKG"
         replace region = "LCN"  if `match' == "HND"
         replace region = "NA"  if `match' == "HPC"
         replace region = "ECS"  if `match' == "HRV"
         replace region = "LCN"  if `match' == "HTI"
         replace region = "ECS"  if `match' == "HUN"
         replace region = "NA"  if `match' == "IBB"
         replace region = "NA"  if `match' == "IBD"
         replace region = "NA"  if `match' == "IBT"
         replace region = "NA"  if `match' == "IDA"
         replace region = "NA"  if `match' == "IDB"
         replace region = "EAS"  if `match' == "IDN"
         replace region = "NA"  if `match' == "IDX"
         replace region = "ECS"  if `match' == "IMN"
         replace region = "SAS"  if `match' == "IND"
         replace region = "NA"  if `match' == "INX"
         replace region = "ECS"  if `match' == "IRL"
         replace region = "MEA"  if `match' == "IRN"
         replace region = "MEA"  if `match' == "IRQ"
         replace region = "ECS"  if `match' == "ISL"
         replace region = "MEA"  if `match' == "ISR"
         replace region = "ECS"  if `match' == "ITA"
         replace region = "LCN"  if `match' == "JAM"
         replace region = "MEA"  if `match' == "JOR"
         replace region = "EAS"  if `match' == "JPN"
         replace region = "ECS"  if `match' == "KAZ"
         replace region = "SSF"  if `match' == "KEN"
         replace region = "ECS"  if `match' == "KGZ"
         replace region = "EAS"  if `match' == "KHM"
         replace region = "EAS"  if `match' == "KIR"
         replace region = "LCN"  if `match' == "KNA"
         replace region = "EAS"  if `match' == "KOR"
         replace region = "MEA"  if `match' == "KWT"
         replace region = "NA"  if `match' == "LAC"
         replace region = "EAS"  if `match' == "LAO"
         replace region = "MEA"  if `match' == "LBN"
         replace region = "SSF"  if `match' == "LBR"
         replace region = "MEA"  if `match' == "LBY"
         replace region = "LCN"  if `match' == "LCA"
         replace region = "NA"  if `match' == "LCN"
         replace region = "NA"  if `match' == "LCR"
         replace region = "NA"  if `match' == "LDC"
         replace region = "NA"  if `match' == "LIC"
         replace region = "ECS"  if `match' == "LIE"
         replace region = "SAS"  if `match' == "LKA"
         replace region = "NA"  if `match' == "LMC"
         replace region = "NA"  if `match' == "LMY"
         replace region = "SSF"  if `match' == "LSO"
         replace region = "NA"  if `match' == "LTE"
         replace region = "ECS"  if `match' == "LTU"
         replace region = "ECS"  if `match' == "LUX"
         replace region = "ECS"  if `match' == "LVA"
         replace region = "EAS"  if `match' == "MAC"
         replace region = "LCN"  if `match' == "MAF"
         replace region = "MEA"  if `match' == "MAR"
         replace region = "NA"  if `match' == "MCA"
         replace region = "ECS"  if `match' == "MCO"
         replace region = "ECS"  if `match' == "MDA"
         replace region = "NA"  if `match' == "MDE"
         replace region = "SSF"  if `match' == "MDG"
         replace region = "SAS"  if `match' == "MDV"
         replace region = "NA"  if `match' == "MEA"
         replace region = "LCN"  if `match' == "MEX"
         replace region = "EAS"  if `match' == "MHL"
         replace region = "NA"  if `match' == "MIC"
         replace region = "ECS"  if `match' == "MKD"
         replace region = "SSF"  if `match' == "MLI"
         replace region = "MEA"  if `match' == "MLT"
         replace region = "EAS"  if `match' == "MMR"
         replace region = "NA"  if `match' == "MNA"
         replace region = "ECS"  if `match' == "MNE"
         replace region = "EAS"  if `match' == "MNG"
         replace region = "EAS"  if `match' == "MNP"
         replace region = "SSF"  if `match' == "MOZ"
         replace region = "SSF"  if `match' == "MRT"
         replace region = "SSF"  if `match' == "MUS"
         replace region = "SSF"  if `match' == "MWI"
         replace region = "EAS"  if `match' == "MYS"
         replace region = "NA"  if `match' == "NAC"
         replace region = "NA"  if `match' == "NAF"
         replace region = "SSF"  if `match' == "NAM"
         replace region = "EAS"  if `match' == "NCL"
         replace region = "SSF"  if `match' == "NER"
         replace region = "SSF"  if `match' == "NGA"
         replace region = "LCN"  if `match' == "NIC"
         replace region = "ECS"  if `match' == "NLD"
         replace region = "NA"  if `match' == "NLS"
         replace region = "ECS"  if `match' == "NOR"
         replace region = "SAS"  if `match' == "NPL"
         replace region = "NA"  if `match' == "NRS"
         replace region = "EAS"  if `match' == "NRU"
         replace region = "NA"  if `match' == "NXS"
         replace region = "EAS"  if `match' == "NZL"
         replace region = "NA"  if `match' == "OED"
         replace region = "MEA"  if `match' == "OMN"
         replace region = "NA"  if `match' == "OSS"
         replace region = "SAS"  if `match' == "PAK"
         replace region = "LCN"  if `match' == "PAN"
         replace region = "LCN"  if `match' == "PER"
         replace region = "EAS"  if `match' == "PHL"
         replace region = "EAS"  if `match' == "PLW"
         replace region = "EAS"  if `match' == "PNG"
         replace region = "ECS"  if `match' == "POL"
         replace region = "NA"  if `match' == "PRE"
         replace region = "LCN"  if `match' == "PRI"
         replace region = "EAS"  if `match' == "PRK"
         replace region = "ECS"  if `match' == "PRT"
         replace region = "LCN"  if `match' == "PRY"
         replace region = "MEA"  if `match' == "PSE"
         replace region = "NA"  if `match' == "PSS"
         replace region = "NA"  if `match' == "PST"
         replace region = "EAS"  if `match' == "PYF"
         replace region = "MEA"  if `match' == "QAT"
         replace region = "ECS"  if `match' == "ROU"
         replace region = "NA"  if `match' == "RRS"
         replace region = "NA"  if `match' == "RSO"
         replace region = "ECS"  if `match' == "RUS"
         replace region = "SSF"  if `match' == "RWA"
         replace region = "NA"  if `match' == "SAS"
         replace region = "MEA"  if `match' == "SAU"
         replace region = "NA"  if `match' == "SCE"
         replace region = "SSF"  if `match' == "SDN"
         replace region = "SSF"  if `match' == "SEN"
         replace region = "EAS"  if `match' == "SGP"
         replace region = "EAS"  if `match' == "SLB"
         replace region = "SSF"  if `match' == "SLE"
         replace region = "LCN"  if `match' == "SLV"
         replace region = "ECS"  if `match' == "SMR"
         replace region = "SSF"  if `match' == "SOM"
         replace region = "ECS"  if `match' == "SRB"
         replace region = "NA"  if `match' == "SSA"
         replace region = "SSF"  if `match' == "SSD"
         replace region = "NA"  if `match' == "SSF"
         replace region = "NA"  if `match' == "SST"
         replace region = "SSF"  if `match' == "STP"
         replace region = "LCN"  if `match' == "SUR"
         replace region = "ECS"  if `match' == "SVK"
         replace region = "ECS"  if `match' == "SVN"
         replace region = "ECS"  if `match' == "SWE"
         replace region = "SSF"  if `match' == "SWZ"
         replace region = "LCN"  if `match' == "SXM"
         replace region = "NA"  if `match' == "SXZ"
         replace region = "SSF"  if `match' == "SYC"
         replace region = "MEA"  if `match' == "SYR"
         replace region = "LCN"  if `match' == "TCA"
         replace region = "SSF"  if `match' == "TCD"
         replace region = "NA"  if `match' == "TEA"
         replace region = "NA"  if `match' == "TEC"
         replace region = "SSF"  if `match' == "TGO"
         replace region = "EAS"  if `match' == "THA"
         replace region = "ECS"  if `match' == "TJK"
         replace region = "ECS"  if `match' == "TKM"
         replace region = "NA"  if `match' == "TLA"
         replace region = "EAS"  if `match' == "TLS"
         replace region = "NA"  if `match' == "TMN"
         replace region = "EAS"  if `match' == "TON"
         replace region = "NA"  if `match' == "TSA"
         replace region = "NA"  if `match' == "TSS"
         replace region = "LCN"  if `match' == "TTO"
         replace region = "MEA"  if `match' == "TUN"
         replace region = "ECS"  if `match' == "TUR"
         replace region = "EAS"  if `match' == "TUV"
         replace region = "EAS"  if `match' == "TWN"
         replace region = "SSF"  if `match' == "TZA"
         replace region = "SSF"  if `match' == "UGA"
         replace region = "ECS"  if `match' == "UKR"
         replace region = "NA"  if `match' == "UMC"
         replace region = "LCN"  if `match' == "URY"
         replace region = "NAC"  if `match' == "USA"
         replace region = "ECS"  if `match' == "UZB"
         replace region = "LCN"  if `match' == "VCT"
         replace region = "LCN"  if `match' == "VEN"
         replace region = "LCN"  if `match' == "VGB"
         replace region = "LCN"  if `match' == "VIR"
         replace region = "EAS"  if `match' == "VNM"
         replace region = "EAS"  if `match' == "VUT"
         replace region = "NA"  if `match' == "WLD"
         replace region = "EAS"  if `match' == "WSM"
         replace region = "ECS"  if `match' == "XKX"
         replace region = "NA"  if `match' == "XZN"
         replace region = "MEA"  if `match' == "YEM"
         replace region = "SSF"  if `match' == "ZAF"
         replace region = "SSF"  if `match' == "ZMB"
         replace region = "SSF"  if `match' == "ZWE"

*********************

 lab var region                          "Region Code"

*********************

 end