ReHow to replace non-missing duplicate responses in Multiple Response sets?

Posted by Art Kendall on
URL: http://spssx-discussion.165.s1.nabble.com/ReHow-to-replace-non-missing-duplicate-responses-in-Multiple-Response-sets-tp5740498.html

Once again I am trying to avoid re-inventing the wheel. Has anybody already
worked this out?

For each response in a list after the first with a positive value, look back
to see if any previous value has the same positive value. If it IS a match,
replace it with -2. Else, leave it alone.

I have multiple-response sets. When a response with a positive value is
mentioned again I would like to replace its value with a specific missing
value. It is valid
The example below only has 3 in a set, but I am looking for something more
general up to a dozen or so responses in a set. and 40 or more specific
values that could be mentioned.

Snack1 to Snack3 are the responses
Want1 to Want3 are what I would like to end up with.
Cases 06 to 08 would have different values after the transformations.

* Name up to 3 snacks you had today."
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 'Cherries'
    3 'Orange'
    -3 'No response for any snack'
    -2 'duplicate of earlier response'
    -1 'fewer responses in Multiple Response'.
list.



-----
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