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
>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. :
>ID Income Group Action
>1 10 A A
>1 20 B A, etc.
>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.
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
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
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
SPSS Technical Support