Is there a clever way to simplify this procedure?
We may assume that the set of dummy variables is disjoint. I have no preference about which dummy gets which value (e.g. _MENA = 3), but the values should be labeled. This seems like a common thing to want to do, but I don't see a more elegant way to do it.
Code:
g regionstr = "" foreach region in _MENA _SSAF _LAC _WEOFF _EECA _SEAS { replace regionstr = "`region'" if `region' } encode regionstr, g(region)
Comment