Date: Sat, 5 Nov 2005 23:49:16 -0600
Reply-To: gornykm@comnetcom.net
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Karen Gorny <gornykm@comnetcom.net>
Subject: Re: File Restructure
In-Reply-To: <200511052356.jA5M0P4g013346@malibu.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
Anton: It's possible with syntax.
DATA LIST free /id (F2.0) count (F1.0) date (ADATE10).
BEGIN DATA
67 3 05/06/2004
67 2 05/22/2004
11 2 06/05/2004
11 1 12/12/2004
98 2 11/23/2005
END DATA.
EXE.
LOOP #i=1 to count.
XSAVE outfile='test.sav' / keep id date.
END LOOP.
EXECUTE.
GET file'test.sav'.
LIST.
Karen
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Anton
Sent: Saturday, November 05, 2005 5:57 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: File Restructure
Dear Listers-
I have a data set with three variables (ID, Count, Date) that I would like
to restructure (disaggregate?) into two variables (ID, Date). Each ID
occurs multiple times. Count refers to the number of episodes occuring on
each date.
In other words, I want to go from this:
67 3 05/06/2004
67 2 05/22/2004
11 2 06/05/2004
11 1 12/12/2004
98 2 11/23/2005
To something like this:
67 05/06/2004
67 05/06/2004
67 05/06/2004
67 05/22/2004
67 05/22/2004
11 06/05/2004
11 06/05/2004
11 12/12/2004
98 11/23/2005
98 11/23/2005
I have been using restructure from the drop-down menu and still can't quite
get it right.
Thanks in advance for your help.
Anton