Date: Thu, 28 Jan 2010 22:24:17 +0000 Dennis Deck "SPSSX(r) Discussion" Dennis Deck Re: CTABLES Problem To: Peter Cuttance <11C0717F-3D4F-44FE-80A1-7724D7B2218B@radii.org> multipart/alternative;

If you have a list of the subjects (SUBJECTID) then simply copy that into the DO REPEAT logic. DO REPEAT s = subject1 subject2 . . . . Takes all of 2 minutes

You might be able to get CTABLES to place the next subject below rather than to the right. One thought was to add a dummy variable to force CTABLES to put the next subject below rather to the right (not sure if that will work but easy to try) COMPUTE Dummy = 1 . CTABLES . . . .. BY Dummy BY SubjectID .

Dennis ________________________________ From: Peter Cuttance [mailto:cuttance@radii.org] Sent: Thursday, January 28, 2010 11:08 AM To: Dennis Deck Subject: Re: CTABLES Problem

Hi Dennis

That would work OK - but, there are 300+ tables, so I am looking for something less laborious.

Cheers Peter

Prof Peter Cuttance Director Research Australia Development and Innovation Institute (radii.org) Ph. +613 9534 2934 Mob. +61 428 990 904 Fax. +613 8640 0741 Suite 71 197 Canterbury Road St Kilda West Victoria AUSTRALIA 3182

On 29/01/2010, at 4:45 AM, Dennis Deck wrote:

Sounds like you really want one table at a time then I would use something like:

TEMPORARY . SELECT IF (SubjectID= ) . (table syntax here)

Or use FILTER rather then the SELECT IF

You can use DO REPEAT logic if you have many tables to generate: Or can embed the CTABLES command in a macro

DO REPEAT s = subject1 subject2 . . . . + TEMPORARY . + SELECT IF (SubjectID=s) . + (table command here) END REPEAT .

Note that SELECT IF and FILTER do not require data to be presorted as SPLIT FILES does. I rarely use SPLIT FILES personally as my break vars are often not usually mutually exclusive

Dennis ________________________________ From: Peter Cuttance [mailto:cuttance@radii.org] Sent: Thursday, January 28, 2010 3:44 AM To: Dennis Deck Subject: Re: CTABLES Problem

Hi Dennis

SUBJECTID is the ID for the subject the student is studying - each student has responded to a standard survey for each subject they have studied.

Dropping BY BY and replacing it with BY simply results in a table that is N tables wide (where N is the number of separate SUBJECTID's.

I want a separate set of table results for the survey for each SUBJECTID - nornally this would be achieved by SPLIT FILE BY SUBJECTID, but this is not supported in CTABLES.

Any suggestions would be welcome.

Regards Peter

Research Australia Development and Innovation Institute (radii.org) Ph. +613 9534 2934 Mob. +61 428 990 904 Fax. +613 8640 0741 Suite 71 197 Canterbury Road St Kilda West Victoria AUSTRALIA 3182

On 28/01/2010, at 4:59 PM, Dennis Deck wrote:

Not sure why you are trying "BY BY" - a single "BY" is the proper syntax.

Perhaps you have a good reason to break the summary by SUBJECTID but it seems suspect. Do you have more than one case per subject? And why would you average by subject anyway? I would expect a variable like Group or StudyCondition or Time . . ..

A simple command for checking results, of course, would be:

CROSSTABS Tables= R1_1 R2_1 R3_1 R4_1 R5_1 R6_1 R7_1 R8_1 R9_1 R10_1 R11_1 R12_1 R13_1 R14_1 R15_1 R17_1 R18_1 R19_1 R20_1 R21_1 by Group /Cells= Count Row .

Dennis Deck RMC Research

________________________________ From: Peter Cuttance [mailto:cuttance@radii.org] Sent: Wednesday, January 27, 2010 12:48 PM Subject: CTABLES Problem

Can anyone tell me why the syntax below is producing the table for only one of the values of SUBJECTID?

I am using BY BY SUBJECTID in lieu of SPLIT FILE BY SUBJECTID which is not supported.

CTABLES /VLABELS VARIABLES=R1_1 R2_1 R3_1 R4_1 R5_1 R6_1 R7_1 R8_1 R9_1 R10_1 R11_1 R12_1 R13_1 R14_1 R15_1 R17_1 R18_1 R19_1 R20_1 R21_1 DISPLAY=LABEL /TABLE (R1_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R2_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R3_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R4_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R5_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R6_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R7_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R8_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R9_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R10_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R11_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R12_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R13_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R14_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R15_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R17_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R18_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R19_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R20_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0] + R21_1 [COUNT F40.0, ROWPCT.COUNT PCT40.0]) BY BY SUBJECTID /SLABELS POSITION=ROW VISIBLE=YES /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=SUBJECTID R1_1 R2_1 R3_1 R4_1 R5_1 R6_1 R7_1 R8_1 R9_1 R10_1 R11_1 R12_1 R13_1 R14_1 R15_1 R17_1 R18_1 R19_1 R20_1 R21_1 ORDER=A KEY=LABEL MISSING=EXCLUDE EMPTY=EXCLUDE.

[text/html]

Back to: Top of message | Previous page | Main SPSSX-L page