My survey data contains several thousand observations across 300+
groups.
I want to produce a Table for Each Group that lists the Variables down
the left-side and has the category labels across the top (all
variables have the same set of response categories).
For most procedures, this is run by:
SORT CASES BY VAR#1.
SPLIT FILE BY VAR#1.
CTABLES
/VLABELS VARIABLES=R1_1 R2_1 R3_1 R4_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]
BY VAR#1 •••••
The BY VAR#1 would not be used if SPLIT FILES worked.
/SLABELS POSITION=ROW VISIBLE=YES
/CLABELS ROWLABELS=OPPOSITE
/CATEGORIES VARIABLES=YEAR R1_1 R2_1 R3_1 R4_1 ORDER=A KEY=LABEL
MISSING=EXCLUDE EMPTY=EXCLUDE.
••• But SPLIT FILES BY VAR#1. is not supported.
I have received a suggestion that this be set up as a Python program —
but, unfortunately that is not feasible on the machine I am using at
present.
Also, setting up TEMPORARY SELECT IF statements for each Group lacks
elegance and is very inefficient.
Suggestions please.
What about TEMP SELECT IF inside a macro that loops through the values
of the variable you want to split on?
--
Bruce Weaver
bwe...@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/Home
"When all else fails, RTFM."
For the benefit of those who don't read the SPSS mailing list, someone
pointed out that split file doesn't work with CTABLES when the default
setting of "LAYERED BY" is used. The following help file info
confirms this.
• CTABLES ignores SPLIT FILE requests if layered splits (compare
groups in the graphical user interface) are requested. You can compare
groups by using the split variables at the highest nesting level for
row variables. See the TABLE subcommand for nesting variables.