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 (June 1997)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 17 Jun 1997 08:26:14 -0500
Reply-To:     "Tverdek, Edward" <etverdek@SPSS.COM>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From:         "Tverdek, Edward" <etverdek@SPSS.COM>
Subject:      Re: Data restructuring: Multiple cases

Chris: The example below should spread your "item" variables as a single variable across records, and result in the data structure you describe. By convention, uppercase terms are SPSS commands, and lower case terms are variable and file names of your choice. Test it on a subsample of your data and see if it does what you need.

VECTOR x=item1 to item3. LOOP newitem = 1 to 3. COMPUTE score = x(newitem). XSAVE OUTFILE = 'newfile.sav' /KEEP id newitem score. END LOOP. EXECUTE.

I hope this makes the job easier.

Ed Tverdek SPSS Technical Support

>---------- >From: chris chiu[SMTP:chiuwing@PILOT.MSU.EDU] >Sent: Monday, June 16, 1997 7:31 PM >To: Multiple recipients of list SPSSX-L >Subject: Data restructuring: Multiple cases > >Hi, > > I am trying to run the 'variance components' procedure but my system >data set is not entered in the right way. I wonder if anyone has >suggestions to go around this problem? Any comments are welcome. The >following is an example of how my data sets look like. I have a large number >of data sets with many cases, which makes it hard to do it by a spreadsheet. >-- Chris > > >Original Data structure: > >ID Item_1 Item_2 Item_3 >1 2 3 4 >2 1 3 2 >3 4 4 2 > > >Desired Data structure: > >ID Item Score >1 1 2 >1 2 3 >1 3 4 >2 1 1 >2 2 3 >2 3 2 >3 1 4 >3 2 4 >3 3 2 >

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