Date: Thu, 27 May 2004 16:29:02 +0200
Reply-To: Adam Olszówka <adamolszowka@hotmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Adam Olszówka <adamolszowka@hotmail.com>
Subject: Re: Ctables - descending order in groups
Content-Type: text/plain; charset="iso-8859-1"
Thanks for reply. But my problem is that I need var2 variable sorted
separatly for different groups (first sorting for var1=1 and second sorting
for var=2).
As far as I know syntax you wrote sorts variable in total and then keeps
order for all groups.
?
Best,
Adam Olszowka
----- Original Message -----
From: "Peck, Jon" <peck@spss.com>
To: "Adam Olszówka" <adamolszowka@hotmail.com>; <SPSSX-L@LISTSERV.UGA.EDU>
Sent: Thursday, May 27, 2004 3:56 PM
Subject: RE: [SPSSX-L] Ctables - descending order in groups
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