Posted by
Art Kendall on
URL: http://spssx-discussion.165.s1.nabble.com/ReHow-to-replace-non-missing-duplicate-responses-in-Multiple-Response-sets-tp5740498p5740500.html
Thank you.
Once again I was unclear. The "Want" variables were just figured out in my
head.
I'll look at the CTABLES approach.
For the archives.
This demo works. I suggest transforming into new variables until you check
that it worked in your instance.
new file.
data list list/HH (f2)Snack1 to Snack3 (3f2) Want1 to Want3 (3f2).
begin data
01 1 2 3 1 2 3
02 3 2 1 3 2 1
03 1 3 2 1 3 2
04 1 3 -1 1 3 -1
05 1 -1 -1 1 -1 -1
06 1 1 1 1 -2 -2
07 1 2 2 1 2 -2
08 1 2 1 1 2 -2
09 -3 -3 -3 -3 -3 -3
end data.
*MISSING VALUES Snack1 to Want3 (LO THRU -1).
VALUE LABELS Snack1 to Want3
1 'Apple'
2 'Cherry'
3 'Lemon'
-3 'No response for any snack'
-2 'duplicate of earlier response'
-1 'fewer responses in Multiple Response'.
list.
VECTOR S=Snack1 to Snack3.
VECTOR Result(3).
VECTOR R= Result1 to Result3.
LOOP #I =1 to 3.
COMPUTE R(#I) = S(#I).
DO IF #I GT 1.
LOOP #J = 1 to #I-1.
IF R(#I) EQ R(#J) R(#I) = -2.
END LOOP.
END IF.
END LOOP.
LIST.
* remember to APPLY DICTIONARY.
-----
Art Kendall
Social Research Consultants
--
Sent from:
http://spssx-discussion.1045642.n5.nabble.com/=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Art Kendall
Social Research Consultants