I have a data of food item that people eat. The data stored as numeric and labelled with their name. However, I want to create a new string variable of foodname, which receives label values of food. Basically, I would like to do the opposite of labmask command.
I have tried the following code that I found online but
Code:
quietly generate str foodname="" quitely: labellist foodcode forvalues row=1/`=_N'{ local foodcode_name=foodcode[`row'] local foodname: foodname`foodcode' quietly replace foodname="`foodname'" in `row' }
Can you please help?
Thank you so much.
0 Response to Creating a new variable which are label values of other variable
Post a Comment