Without example data that reproduces the problem, I can't give you specific advice. What I can say, at a general level, is that somehow, what you think are "En désaccord" and "En total désaccord" in your data set, really aren't. One possibility is that those responses are padded with leading or trailing blanks, which your eye does not see, but Stata does. If that is the problem
before the -encode- will resolve the problem.
If it is not a matter of blanks, there may be "non-printing" characters embedded in Educ_16, which, again, your eye does not see, but Stata does. Those are more difficult to deal with, as there is no simple cleanup function like trim() to remove them. For a start you can run -chartab- (by Robert Picard, available from SSC) to identify all the characters contained in Educ_16. You will then have to use -subinstr()- or -usubinstr()- to remove them.
Code:
replace `var' = trim(itrim(`var'))
If it is not a matter of blanks, there may be "non-printing" characters embedded in Educ_16, which, again, your eye does not see, but Stata does. Those are more difficult to deal with, as there is no simple cleanup function like trim() to remove them. For a start you can run -chartab- (by Robert Picard, available from SSC) to identify all the characters contained in Educ_16. You will then have to use -subinstr()- or -usubinstr()- to remove them.
Comment