|
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.
*****************************
|