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 (February 1997)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 13 Feb 1997 08:47:49 -0600
Reply-To:     "Alspach, Steve" <alspach@SPSS.COM>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From:         "Alspach, Steve" <alspach@SPSS.COM>
Subject:      Re: Help w/ transforrm or aggregate
Comments: To: Sarah Cohen <sarah_c@IX.NETCOM.COM>

>---------- >From: Sarah Cohen[SMTP:sarah_c@IX.NETCOM.COM] >Sent: Saturday, February 08, 1997 3:46 PM >To: Multiple recipients of list SPSSX-L >Subject: Help w/ transforrm or aggregate > >I have a big data file (10k cases), which include an ID for a company. I'd >like to essentially get a new data file (which would have about 300 cases) >by counting the instances of other variables. It would look a lot like the >output of a crosstab, but then I'd be able to use it as a file. > >I looked at aggregate, and can get the counts (and averages of numeric >variables) by each categorical variable I have. Now I'd like to flip only >categorical ones, so a few variables stay as variables and the rest get >flipped with the values in the middle. : > >Orig data: >ID Income Group Action >1 10 A A >1 20 B A, etc. > >Agg data: >ID Type Group Action YAvg N >1 2 A A 11 250 >1 2 A B 23 20 > >What I want: >ID Type AA AB >1 2 250 20 > >Is there a way to easily save the output of a crosstab or frequencies as a >data file? Or convert a pivot table back into a data file? Or some sort of >option on Flip/Transpose? Or am I missng something in Aggregate? Something? > >Thanks in advance. > >Sarah Cohen.

Sarah,

You can save output from a CROSSTABS procedure by using the PROCEDURE OUTPUT command prior to running the CROSSTABS command. For example,

PROCEDURE OUTPUT outfile='xtab.out'. CROSSTABS variables = v1 v2 (lowval, hival) /tables=v1 by v2 /write=all.

where LOWVAL and HIVAL are the lowest and highest values for V1 and V2. The output is written to a file (in this case called XTAB.OUT) that can be read as an ASCII data file.

The PROCEDURE OUTPUT command is available in SPSS 6.x and 7.x. The command is available only through syntax. Good luck, and thank you for using SPSS.

Steve Alspach SPSS Technical Support


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