Hi there,
I have a long list of people being situated in different regions. Those NUTS3 Regions are labelled e.g. by "DE111 Stuttgart" (DE being the country, DE1 being the NUTS 1 Region, DE11 being the NUTS2 Region). In the dataset they are coded by numerical values from 1 to 942 and unfortunately alphabetically arranged.
I want to create a new variable "nuts1". Thus, I thought I could use a command like:
recode nuts3 ("DE1**"=1) ("DE2**"=2), gen(nuts1)
where DE1** stands for all label values starting with DE1.
However, I'm aware that searching for labels instead of values makes it more complicated.
Hope anyone can help
I have a long list of people being situated in different regions. Those NUTS3 Regions are labelled e.g. by "DE111 Stuttgart" (DE being the country, DE1 being the NUTS 1 Region, DE11 being the NUTS2 Region). In the dataset they are coded by numerical values from 1 to 942 and unfortunately alphabetically arranged.
I want to create a new variable "nuts1". Thus, I thought I could use a command like:
recode nuts3 ("DE1**"=1) ("DE2**"=2), gen(nuts1)
where DE1** stands for all label values starting with DE1.
However, I'm aware that searching for labels instead of values makes it more complicated.
Hope anyone can help

Comment