|
|
Hi all,
I'd like to create many tables with the same structure. In the colomns are the different groups and in the rows the specific question. Each table has an unique titel. Copying the syntax and manually change crossing variables and title is no option as there are many questions.
Below a simplified example for q1 and q2. My question is how to handle this with - say - 999 variables? Can you do this using loops (and if so, how?)?
Many thanks in advance!
Paul
_______________________________________________
*dataset.
data list list / resp q1 q2 q3 q4 q5 q6 q999 group.
begin data
1 4 5 2 1 0 9 8 1
2 3 5 6 1 5 9 6 2
3 4 5 2 6 4 9 5 3
4 1 2 3 5 0 9 4 1
5 4 5 2 1 0 5 8 2
6 4 6 2 7 5 9 7 3
7 4 5 2 1 9 9 5 1
8 4 5 2 1 0 9 2 2
9 4 5 3 1 4 9 1 3
10 4 5 2 1 0 9 8 1
end data.
* Table 1.
TABLES
/FORMAT BLANK MISSING('.')
/GBASE=CASES
/FTOTAL= $t000002 "Total" $t000001 "Total"
/TABLE=q1 + $t000002 BY group + $t000001
/STATISTICS
count( group( F5.0 ))
cpct( group( PCT5.1 ) 'Row %':q1 ) /TITLE 'q1 by group'.
* Table 1.
TABLES
/FORMAT BLANK MISSING('.')
/GBASE=CASES
/FTOTAL= $t000002 "Total" $t000001 "Total"
/TABLE=q2 + $t000002 BY group + $t000001
/STATISTICS
count( group( F5.0 ))
cpct( group( PCT5.1 ) 'Row %':q2 ) /TITLE 'q2 by group'.
---------------------------------
Need a vacation? Get great deals to amazing places on Yahoo! Travel.
|