|
Dear SPSS users,
I trying use Ctables since it have many advantages over others but recently I've found that I cannot use the function RESPONSES to calculate the number of responses for each codes in Ctables (it seems to count all duplicated codes by each record as ONE only) while General Tables can do it easily. Here is the data & syntax: data list list / V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14. begin data 1 1 1 67 18 0 0 0 0 0 0 1 1 2 2 1 1 75 17 1 1 0 0 0 1 2 3 3 3 1 1 66 17 0 0 0 0 0 0 2 2 2 4 1 1 67 15 0 0 0 0 0 0 3 3 0 5 0 1 75 21 0 0 0 0 1 0 3 2 4 6 1 1 74 17 0 0 0 0 0 0 3 1 3 7 1 1 69 18 0 0 0 0 0 1 4 1 0 8 0 1 74 18 1 1 0 0 0 1 2 0 4 9 1 1 66 18 0 0 0 0 0 0 2 3 0 10 1 1 68 16 0 0 0 0 0 0 2 1 3 11 0 1 71 16 0 0 0 0 0 0 4 3 4 12 1 1 66 17 0 0 0 0 0 1 4 2 2 13 0 1 73 15 0 1 0 0 0 0 3 1 2 14 1 1 71 17 0 0 0 0 0 0 2 4 3 15 0 1 75 20 0 0 0 0 0 0 3 3 3 16 1 1 69 17 0 1 0 0 0 0 4 1 2 17 0 1 72 15 0 0 0 0 0 1 2 1 3 18 1 1 73 19 0 0 0 0 0 0 1 2 3 19 1 1 68 18 0 0 0 0 0 0 2 1 2 20 1 1 70 17 0 0 0 0 0 1 3 2 2 end data. * General Tables. TABLES /FORMAT BLANK MISSING('.') /MRGROUP $all v1 to v14 /GBASE=CASES /TABLE=$all BY (STATISTICS) /STATISTICS responses( $all( F5.0 )) /TITLE 'NUMBER OF RESPONSES'. ********. MRSETS /MCGROUP NAME= $all VARIABLES= v1 to v14. * Custom Tables. CTABLES /VLABELS VARIABLES=$ALL DISPLAY=DEFAULT /TABLE $ALL [c] [RESPONSES 'Responses' F40.0] /CATEGORIES VARIABLES=$ALL ORDER=A KEY=VALUE EMPTY=INCLUDE POSITION=BEFORE MISSING=EXCLUDE. I'm very grateful if any one can take a look & let me know what was wrong with my Ctables. The data file is attached for your reference Thank you so much, Hop |
|
Hi Tran,
This does it: * Custom Tables. CTABLES /VLABELS VARIABLES=$ALL DISPLAY=DEFAULT /MRSETS COUNTDUPLICATES= YES /TABLE $ALL [c] [RESPONSES 'Responses' F40.0] /CATEGORIES VARIABLES=$ALL ORDER=A KEY=VALUE EMPTY=INCLUDE POSITION=BEFORE MISSING=EXCLUDE. Cheers! Raynald Levesque www.spsstools.net On 7/31/07, Tran Robert <[hidden email]> wrote: > > Dear SPSS users, > > I trying use Ctables since it have many advantages over others but > recently > I've found that I cannot use the function RESPONSES to calculate the > number > of responses for each codes in Ctables (it seems to count all duplicated > codes by each record as ONE only) while General Tables can do it easily. > > Here is the data & syntax: > > data list list / V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14. > begin data > 1 1 1 67 18 0 0 0 0 0 0 1 1 2 > 2 1 1 75 17 1 1 0 0 0 1 2 3 3 > 3 1 1 66 17 0 0 0 0 0 0 2 2 2 > 4 1 1 67 15 0 0 0 0 0 0 3 3 0 > 5 0 1 75 21 0 0 0 0 1 0 3 2 4 > 6 1 1 74 17 0 0 0 0 0 0 3 1 3 > 7 1 1 69 18 0 0 0 0 0 1 4 1 0 > 8 0 1 74 18 1 1 0 0 0 1 2 0 4 > 9 1 1 66 18 0 0 0 0 0 0 2 3 0 > 10 1 1 68 16 0 0 0 0 0 0 2 1 3 > 11 0 1 71 16 0 0 0 0 0 0 4 3 4 > 12 1 1 66 17 0 0 0 0 0 1 4 2 2 > 13 0 1 73 15 0 1 0 0 0 0 3 1 2 > 14 1 1 71 17 0 0 0 0 0 0 2 4 3 > 15 0 1 75 20 0 0 0 0 0 0 3 3 3 > 16 1 1 69 17 0 1 0 0 0 0 4 1 2 > 17 0 1 72 15 0 0 0 0 0 1 2 1 3 > 18 1 1 73 19 0 0 0 0 0 0 1 2 3 > 19 1 1 68 18 0 0 0 0 0 0 2 1 2 > 20 1 1 70 17 0 0 0 0 0 1 3 2 2 > end data. > > * General Tables. > TABLES > /FORMAT BLANK MISSING('.') /MRGROUP $all v1 to v14 > /GBASE=CASES > /TABLE=$all BY (STATISTICS) > /STATISTICS > responses( $all( F5.0 )) /TITLE 'NUMBER OF RESPONSES'. > > ********. > > MRSETS > /MCGROUP NAME= $all > VARIABLES= v1 to v14. > * Custom Tables. > CTABLES > /VLABELS VARIABLES=$ALL DISPLAY=DEFAULT > /TABLE $ALL [c] [RESPONSES 'Responses' F40.0] > /CATEGORIES VARIABLES=$ALL ORDER=A KEY=VALUE EMPTY=INCLUDE > POSITION=BEFORE MISSING=EXCLUDE. > > I'm very grateful if any one can take a look & let me know what was wrong > with my Ctables. The data file is attached for your reference > > Thank you so much, > > Hop > |
| Free forum by Nabble | Edit this page |
