LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2004)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 20 May 2004 15:57:51 -0400
Reply-To:   "Hetter, Rebecca D,,DMDCWEST" <HETTERRD@osd.pentagon.mil>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   "Hetter, Rebecca D,,DMDCWEST" <HETTERRD@osd.pentagon.mil>
Subject:   Re: Restructuring data
Content-Type:   text/plain; charset="iso-8859-1"

This might do it (untested syntax):

save outfile temp1/drop= v4 v5 v6. save outfile temp2/drop= v1 v2 v3/ren=(v4 v5 v6=v1 v2 v3). add files file=temp1/file=temp2 .

If you need to maintain the original order of the records, then try this:

compute seqno=$casenum. compute recno= 1. save outfile temp1/drop= v4 v5 v6. compute recno= 2. save outfile temp2/drop= v1 v2 v3/ren=(v4 v5 v6=v1 v2 v3). add files file=temp1/file=temp2/by seqno recno.

HTH,

Becky Hetter

-----Original Message----- From: Henrik Clausen [mailto:clausen@wilke.dk] Sent: Thursday, May 20, 2004 12:07 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Restructuring data

I have some data in the following form:

v1 v2 v3 v4 v5 v6 1 x1 y1 z1 x2 y2 z2 2 x3 y3 z3 x4 y4 z4 3 and so on

I would like the data to be restructured into the following way:

v1 v2 v3 1 x1 y1 z1 2 x2 y2 z2 3 x3 y3 z3 4 x4 y4 z4

I've tried to use the restructure function in spss 12.0 but with little success - maybe because I'm using it the wrong way. I have a lot of columns and rows so a syntax would be appreciated..

Thanks Henrik

Med venlig hilsen / Kind Regards Henrik Kjærgaard Clausen

E-mail: clausen@wilke.dk URL: http://www.wilke.dk/ <http://www.wilke.dk/> Telefon: +45 70 10 20 80 Fax: +45 70 10 20 81

Wilke A/S Vindegade 53, 1. DK-5000 Odense

*****************************

This message contains privileged and confidential information intended only for the use of the addressee named above. If you are not the intended recipient of this message you are hereby notified that you must not disseminate, copy or take any action in reliance on it. If you have received this message in error please notify Wilke A/S immediately.

*****************************


Back to: Top of message | Previous page | Main SPSSX-L page