I have a variable called aa, it has 5 values: very satisfied, satisfied,dissatisfied,very dissatisfied,neither satisfied nor dissatisfied.
I need to convert the value of "very satisfied" into "5", "satisfied" into "4", and so on.
I tried this command:
xtile bb=aa,nq(5)
but the outcome is weird, because it only those 5 value into 1, 4, 5. I cannot find the number of 2 and 3 in the result. This means "very dissastified" and "dissatisfied"are converted into the same number "5", "very satisfied" and "satisfied" are converted to the same number, "1". I don't know why, who can help me out?
encode, notxtile, as inencode aa, gen(bb). – whuber♦ Jul 26 '11 at 20:55Data|Create or change data|...doesn't bring up anything obvious. It turns out you need to chooseEncode value labels from string variable, which even I (as a native English speaker with some Stata familiarity) find less than clear. – whuber♦ Jul 26 '11 at 21:02