|
The following syntax creates a custom table that places two
nominal variables (q2 and catq3) in the column dimension and a single nominal
variable (q12) in the row dimension. It also creates count columns, N% columns, total columns,
and a total row. It then conducts both a Chi square test and Bonferroni-adjusted
tests on percentage differences. I’d like to run this syntax on a large number of row
variables while retaining the same columns. I want to avoid simply stacking all my row variables in the
row dimension and generating one gigantic table. I’d like to generate a separate table and significance
testing output for each row variable. Can anyone show me how to write the syntax, macro or OMS
commands necessary to instruct SPSS (or PASW) to substitute row variables from
a specified list and generate a series of tables by repeating this syntax until
the Banner it creates is run against each of the specified row variables? In other words, I want to instruct SPSS to run this syntax
using q12 as the row variable and run it again substituting q2 as the row
variable and run it again substituting q3 as the row variable, etc. without
having to manually change the row variable specifications. I’m running SPSS 14.0.1 with the Tables module. I don’t
know whether Python can be used with 14.0.1 but I’m not Python literate
anyway, so a Python solution will not be particularly helpful. Thanks in advance. Here’s some trial data with my
tables syntax. DATA LIST FREE/ id q2 q3 q4 q5 q6 q12
q17 catq3 (9f3.0). BEGIN DATA 101 1 1 2 1 1 4 1 2 102 3 1 3 1 4 4 4 2 103 4
4 3 1 3 4 3 2 104 3 4 3 4 4 3 3 1 105 2 4 3 2 2 2 3 2 106 3
1 4 2 4 2 4 1 107 2 3 3 2 2 1 2 2 108 1 2 2 1 1 1 3 1 109 2
4 3 2 1 1 1 2 110 3 4 1 1 3 4 3 2 111 4 1 3 3 1 4 1 1 112 1
2 2 3 2 4 3 2 113 1 4 3 3 1 2 1 1 114 1 4 1 1 4 4 3 1 115 2
4 3 1 3 3 3 1 116 4 2 2 1 3 4 4 2 117 1 4 3 1 3 2 2 2 118 2
1 4 4 3 1 2 2 119 2 4 3 3 2 4 3 2 120 4 2 3 2 4 3 3 2 121 2
4 3 1 4 4 3 1 122 1 4 1 2 3 1 3 1 123 1 1 2 3 4 1 4 1 124 1
3 4 2 3 1 2 2 125 3 3 2 4 1 4 2 2 126 3 4 3 1 1 2 2 2 127 4
4 1 1 1 4 4 2 128 3 3 2 1 4 2 1 2 129 1 1 4 4 4 2 3 2 130 1
3 3 3 2 3 4 1 END DATA. VALUE LABELS q2 1 'Blue' 2 'Red' 3 'Orange' 4
'Black' /q3
1 'Jan' 2 'Feb' 3 'Mar' 4 'Apr' /q4
1 'Bill' 2 'Todd' 3 'Jim' 4 'Bud' /q5
1 'Dog' 2 'Cat' 3 'Bird' 4 'Chimp' /q6
1 'Animal' 2 'Mineral' 3 'Vegetable' 4 'Other' /q12
1 'NY' 2 'CA' 3 'TX' 4 'FL' /q17
1 'Bus' 2 'Train' 3 'Car' 4 'Plane' /catq3
1 'Big' 2 'Little'. VARIABLE LEVEL id TO catq3 (nominal). CTABLES /VLABELS VARIABLES=Q2 CatQ3 Q12
DISPLAY=DEFAULT /TABLE Q12 BY Q2 [COUNT F40.0,
COLPCT.COUNT PCT40.1] + CatQ3 [COUNT F40.0, COLPCT.COUNT PCT40.1] /CATEGORIES VARIABLES=Q2 CatQ3 Q12
ORDER=A KEY=VALUE EMPTY=INCLUDE TOTAL=YES POSITION=AFTER /SIGTEST TYPE=CHISQUARE ALPHA=0.05
INCLUDEMRSETS=YES CATEGORIES=ALLVISIBLE /COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=BONFERRONI
ORIGIN=COLUMN INCLUDEMRSETS=YES
CATEGORIES=ALLVISIBLE. |
| Free forum by Nabble | Edit this page |
