Hi!
I have to assign value labels to a large data set. All necessary information is saved in an excel table that I loaded into stata. For some variables, there are more items (e.g., v32200_1 v3220_2 ...) which all have the same scale and therefore get the same lable. I removed them therefore from the data. But they need to be assigned the value label (therefore I nedd to code var*). I need a stata code that can use the data and will give me as an output a text file with the following code for each variable:
label define varlbl 1 "yes" 2 "no"
label var* varlbl
var values envallab
v32200 1 yes
v32200 2 no
v32200 -7 I do not want to answer
v32200 -8 I cannot answer that
v32202 1 very good
v32202 2 rather good
v32202 3 rather bad
v32202 4 very bad
v32202 -7 I do not want to answer
v32202 -8 I cannot answer that
v32203 1 very often
v32203 2 often
v32203 3 sometimes
v32203 4 not at all
v32203 -7 I do not want to answer
v32203 -8 I cannot answer that
v32204 1 completely true
v32204 2 a bit true
v32204 3 rather not true
v32204 4 not true at all
v32204 -7 I do not want to answer
v32204 -8 I cannot answer that
...
Very greatful for any help to get this job done!
Best, Katrina
I have to assign value labels to a large data set. All necessary information is saved in an excel table that I loaded into stata. For some variables, there are more items (e.g., v32200_1 v3220_2 ...) which all have the same scale and therefore get the same lable. I removed them therefore from the data. But they need to be assigned the value label (therefore I nedd to code var*). I need a stata code that can use the data and will give me as an output a text file with the following code for each variable:
label define varlbl 1 "yes" 2 "no"
label var* varlbl
var values envallab
v32200 1 yes
v32200 2 no
v32200 -7 I do not want to answer
v32200 -8 I cannot answer that
v32202 1 very good
v32202 2 rather good
v32202 3 rather bad
v32202 4 very bad
v32202 -7 I do not want to answer
v32202 -8 I cannot answer that
v32203 1 very often
v32203 2 often
v32203 3 sometimes
v32203 4 not at all
v32203 -7 I do not want to answer
v32203 -8 I cannot answer that
v32204 1 completely true
v32204 2 a bit true
v32204 3 rather not true
v32204 4 not true at all
v32204 -7 I do not want to answer
v32204 -8 I cannot answer that
...
Very greatful for any help to get this job done!
Best, Katrina
Comment