Date: Fri, 16 Jul 2004 02:26:36 GMT
Reply-To: julierog@ix.netcom.com
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roger Lustig <trovato@VERIZON.NET>
Subject: Re: sum
Content-Type: text/plain; charset=us-ascii; format=flowed
June:
Arrays might well be used, though
sum(of q1-q12)
is nice too.
However, I'm not sure what you're looking to do. Could you show us
what the output data set would look like?
Best,
Roger
June wrote:
> Hi,
>
> I have a data set like below:
>
> Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Sum
> 1 1 2 1 1 1 2 1 1 2 1 1
> 2 1 1 1 2 1 1 2 1 1 2 2
> 1 2 1 2 1 2 1 2 1 2 1 1
> 2 2 2 2 2 1 2 1 2 2 2 2
> 1 1 1 1 1 2 1 1 1 1 2 1
> 1 2 1 2 1 1 2 1 2 2 1 2
> 2 1 2 1 2 1 1 2 1 1 2 1
> 2 2 1 1 2 1 2 2 2 1 1 2
>
> Q1 to q12 has two value(1,2), How could I calculate the sum by row when Q(i)=1?
> Q(i)=2 can not be changed.
>
> Do you think array can be used ?
>
> Thanks.
|