Date: Sat, 4 Feb 2006 12:33:47 +0100
Reply-To: Arnaldo Ferrari Nasi <vs.arni@tiscalinet.it>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Arnaldo Ferrari Nasi <vs.arni@tiscalinet.it>
Subject: converting dichotomized single choiche response to single choiche
categories
Content-Type: text/plain; charset="us-ascii"; format=flowed
Hi List,
I have a file with all the variable like this:
data list free/ id q1.1 q1.2 q1.3 q2.1 q2.2.
begin data
001 0 0 1 1 0
002 1 0 0 1 0
003 0 1 0 0 1
004 0 0 1 0 1
end data.
I would have a file like this:
data list free/ id q1 q2
begin data
001 3 1
002 1 1
003 2 2
004 3 2
end data.
Obviously, I can do this with a lot of if-statements, but I'd like to know
if there is a faster way.
Thanks in advance,
Arnaldo.
|