Date: Thu, 27 May 2004 08:56:05 -0500
Reply-To: "Peck, Jon" <peck@spss.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Peck, Jon" <peck@spss.com>
Subject: Re: Ctables - descending order in groups
Content-Type: text/plain; charset="iso-8859-1"
You control the sorting on the CATEGORIES subcommand. Here is an example using the employee data file.
CTABLES
/VLABELS VARIABLES=minority jobcat DISPLAY=DEFAULT
/TABLE minority > jobcat [COUNT F40.0]
/CATEGORIES VARIABLES=minority ORDER=A KEY=VALUE EMPTY=INCLUDE MISSING=EXCLUDE
/CATEGORIES VARIABLES=jobcat ORDER=D KEY=COUNT EMPTY=INCLUDE MISSING=EXCLUDE.
In the dialog interface, you can select the inner variable, jobcat in this example, and open the Categories and Total subdialog. There is a section there where you can choose what to sort on and the direction.
Regards,
Jon Peck
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Adam Olszówka
Sent: Thursday, May 27, 2004 6:43 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: [SPSSX-L] Ctables - descending order in groups
Hi everybody,
Please excuse if this has already been discussed, as I am new to the list.
I haven't found solution of my problem in the archive so far.
I have two variables: var1 nad var2.
I can make the table (using ctables commad) like this:
count
| var2=1 15
var1=1 | var2=2 10
| var2=3 25
___________________
| var2=1 10
var1=2 | var2=2 2
| var2=3 5
But I want them to be sorted in descending order in groups:
count
| var2=3 25
var1=1 | var2=1 15
| var2=2 10
___________________
| var2=1 10
var1=2 | var2=3 5
| var2=2 2
Any idea how to do it in ctables command? Is it possible?
Thanks,
Adam