Re: st: RE: AW: RE: AW: recode 9, 99, 999,..., into missing

Thanks for the explanation!
On May 17, 2010, at 10:29 AM, Martin Weiss wrote:

<>
Just to be sure, we are talking about the "programming if" here -help

ifcmd-, not the qualifier, the source of much confusion in the past
on the

list.

-su, mean- leaves behind a scalar value for the maximum, and the ifs
check
on its range. So there is only one "correct" answer per loop
iteration to
the if/else, and this one is executed. For the -if- qualifier,
nothing much
would change, as discussed earlier, only the code would be executed
more

99 isn't changed because there are bigger values in the same
variable. Thus, it is assumed that it does not mean missing.
Nick
n.j.cox@durham.ac.uk
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu

] On Behalf Of Michael McCulloch
In Martin's code, I noticed that:
for observation #8, var4 is changed to missing,
for observation #4, var3 is not changed to missing.
This puzzled me because they both have "999" as original value.
It also looks like values "9", "999" and "9999" are changed to
missing, but not "99".
Michael
On May 17, 2010, at 9:30 AM, Lachenbruch, Peter wrote:

Dear Mr. Weiss and Lachenbruch,
I am sorry that I should be more clear when describing my question.
In
my opinion, I need to be careful about this problem : for example,
for
a variable that has 10 scales, the 9 value means a real scale and
99
in that case means "not answered".
The pattern is like this:

(1) if the maximum value of a variable is smaller than 9 , then
the

"not answered" takes the value 9;
(2) if the maximum value of a variable is smaller than 99 but
greater
than 10, then the "not answered" takes the value 99;
(3) if the maximum value of a variable is smaller than 999 but
greater than 100, then the "not answered" takes the value 999;
and so on.

(And you are absolutely right for the reminder that there are
values

such as 7,8, 98, or 97 to indicate "refused to answer" "invalid
answer". Here I would like to keep focus on one example of "not
answered" , because the other values could be dealt with using the
same way.)
Thanks for help from both of you!