Date: Sat, 4 Feb 2006 17:07:25 +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: Re: converting dichotomized single choiche response to single
choiche categories
In-Reply-To: <83F93BA4-166B-438D-B62C-48C771A0B150@unimelb.edu.au>
Content-Type: text/plain; charset="us-ascii"; format=flowed
Thanks, it runs.
And if I have many contiguos variable with the same structure?
i.e.
Do you like citizens of...
d1.1 USA (yes, no, don't know)
d1.2 Great Britain (yes, no, don't know)
d1.3 France (yes, no, don't know)
...
I have a file like this:
d1.1.1 d1.1.2 d1.1.3 d1.2.1 d1.2.2 d1.2.3 d1.3.1 d1.3.2 d1.3.3 etc.
1 0 0 0 1 0 0 1 0
1 0 0 1 0 0 0 0 1
0 1 0 0 0 1 1 0 0
...
Thanks,
Arnaldo.
>do repeat x=q1.1 to q1.3/y=1 to 3.
>if x q1=y.
>end repeat.
>do repeat x=q2.1 to q2.2/y=1 to 2.
>if x q2=y.
>end repeat.
>exe.
>
>
>
>On 04/02/2006, at 10:33 PM, Arnaldo Ferrari Nasi wrote:
>
>>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.
>
|