Thursday, 9 July 2009

First attempt at CTABLES

I am a big fan of SPSS TABLES, so it took me a while to accept the shift from TABLES to CTABLES. However, I dedicated my morning to get around ctable using the Table builder and then pasting the Syntax. Here is the first syntax I used:

* Custom Tables.

CTABLES
/VLABELS VARIABLES=Q1n Q5n1 Q2n1 DISPLAY=DEFAULT
/TABLE Q1n [C] > Q5n1 [C][COUNT F40.0, COLPCT.COUNT PCT40.1] BY Q2n1 [C]
/CATEGORIES VARIABLES=Q1n ORDER=A KEY=VALUE EMPTY=INCLUDE TOTAL=YES POSITION=AFTER
/CATEGORIES VARIABLES=Q5n1 [1, 2, 3, SUBTOTAL, OTHERNM] EMPTY=INCLUDE POSITION=AFTER
/CATEGORIES VARIABLES=Q2n1 [1, 2, 3, 4, 77, OTHERNM] EMPTY=INCLUDE TOTAL=YES POSITION=AFTER.

*The easiest command would be:
CTABLES /TABLE VAR1 [COLPCT] BY VAR2.


*AND ALSO with simplification the following.

CTABLES
/VLABELS VAR= Q1n Q5n1 Q2n1 DISP=DEFAULT
/TAB Q1n>Q5n1 [COUNT F5.0, COLPCT.COUNT] BY Q2n1
/CAT VAR=Q5n1 [1,2,3, SUBTOTAL] POSITION=AFTER.

* The best part about this syntax is the ability to create SubTotals for the dependent variable which I was unable to do before!

I still need to figure out some more things, including how to use multiple choice questions!