I'm trying to recode a byte variable in my Stata file to a string variable. But it is showing me an error (stating that it doesn't recognize the element). Stringing it isn't working either. Can I do this in Stata?
The data file I have includes the demographic information of continents. I recoded it based on life expectancy (lexp
). The code I'm using is:
recode lexp (min/72 =1) (73/75 = 2) (76/max=3)
Now I need to recode 3
to a string value A
.
Using recode lexp (3=A)
I get
unknown el A in rule