Date: Tue, 14 Jan 2003 16:55:50 -0600
Reply-To: Daniel Sharp <dmsharp@matcmadison.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Daniel Sharp <dmsharp@matcmadison.edu>
Subject: Re: compute
Content-Type: text/plain; charset=US-ASCII
Scott,
Perhaps the Aggregate command will do.
Aggregate outfile='c:\yourdata.sav'
/break=subn
/tot_v1 tot_v2=sum(v1 v2).
this produces one case per subn with tot_v1 and tot_v2 equal to the sum
of each participants values for v1, v2, etc.
Regards,
Dan Sharp
>>> Scott Roesch <roesch@protos.lifesci.ucla.edu> 01/14/03 04:49PM >>>
Hi all:
I have a data file that looks like the following:
subn v1 v2
1 1 0
1 0 1
1 1 1
2 1 1
2 1 0
2 1 0
...
so I have multiple subject entries. What I would like to do is simply
sum
each variable for each participant. For example, I would like to create
a new variable that contains the sum of v1 for participants, 1 and 2,
respectively, and so on. I assumed that I would have to transpose this
data. However, the transpose does not work cleanly because participants
do
not have the same number of scores for v1 (some have 3, some have 5,
etc.). Any help would be greatly appreciated.
Scott
|