Hi all,
I have a large individual-level dataset on jobs. One of the variables is Industry of Work (named: "ind_3dig_p") that identifies, for each person, which industry they work in if they are employed. The variable is a 3-digit code. There is a mapping of codes to industries which I have in a separate file.
For instance,
011 "Growing of non-perennial crops"
015 "Mixed farming" ....and so on...410 "Construction of buildings "...all the way till 990.
I want to add the above labels for these 3 digit codes into my dataset so that I can sort by industry or analyze jobs in a particular industry etc.
Since I have a large number of variables, I want the flexibility of having my codes on different lines using the delimit command. I try to do this as follows:
#delimit ;
label define ind_3dig_label 11 "Growing of non-perennial crops"
12 "Growing of perennial crops"
....
982 "Undifferentiated service-producing activities "
990 "Activities of households" ;
#delimit cr
la values ind_3dig_p ind_3dig_label
However, STATA gives me the following error message, indicating it is getting stuck at the second line of code itself.
"12 is not a valid command name"
Any ideas on how to fix this or another way to get my label values into the dataset? I am running this through my do-file not the command box so that is not the issue.
Thanks in advance.
I have a large individual-level dataset on jobs. One of the variables is Industry of Work (named: "ind_3dig_p") that identifies, for each person, which industry they work in if they are employed. The variable is a 3-digit code. There is a mapping of codes to industries which I have in a separate file.
For instance,
011 "Growing of non-perennial crops"
015 "Mixed farming" ....and so on...410 "Construction of buildings "...all the way till 990.
I want to add the above labels for these 3 digit codes into my dataset so that I can sort by industry or analyze jobs in a particular industry etc.
Since I have a large number of variables, I want the flexibility of having my codes on different lines using the delimit command. I try to do this as follows:
#delimit ;
label define ind_3dig_label 11 "Growing of non-perennial crops"
12 "Growing of perennial crops"
....
982 "Undifferentiated service-producing activities "
990 "Activities of households" ;
#delimit cr
la values ind_3dig_p ind_3dig_label
However, STATA gives me the following error message, indicating it is getting stuck at the second line of code itself.
"12 is not a valid command name"
Any ideas on how to fix this or another way to get my label values into the dataset? I am running this through my do-file not the command box so that is not the issue.
Thanks in advance.
Comment